Commit d801879 1 parent c087a62 commit d801879 Copy full SHA for d801879
File tree 1 file changed +4
-14
lines changed
1 file changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -2043,15 +2043,12 @@ export default class AVPlayer extends Emitter implements ControllerObserver {
2043
2043
this . video ?. play ( ) ,
2044
2044
this . audio ?. play ( )
2045
2045
] ) . catch ( ( error ) => {
2046
+ this . fire ( eventType . RESUME )
2047
+ logger . warn ( 'the audioContext was not started. It must be resumed after a user gesture' )
2046
2048
if ( this . video ) {
2047
2049
this . video . muted = true
2048
- this . fire ( eventType . RESUME )
2049
- logger . warn ( 'the audioContext was not started. It must be resumed after a user gesture' )
2050
2050
return this . video . play ( )
2051
2051
}
2052
- else {
2053
- throw error
2054
- }
2055
2052
} )
2056
2053
}
2057
2054
else {
@@ -2075,10 +2072,6 @@ export default class AVPlayer extends Emitter implements ControllerObserver {
2075
2072
await AVPlayer . AudioRenderThread . fakePlay ( this . taskId )
2076
2073
this . controller . setTimeUpdateListenType ( AVMediaType . AVMEDIA_TYPE_VIDEO )
2077
2074
}
2078
- else {
2079
- // 只有音频无法播放时直接抛错,和 mse 行为保持一致
2080
- throw new Error ( 'the audioContext was not started. It must be resumed after a user gesture' )
2081
- }
2082
2075
}
2083
2076
}
2084
2077
this . status = AVPlayerStatus . PLAYED
@@ -2578,21 +2571,18 @@ export default class AVPlayer extends Emitter implements ControllerObserver {
2578
2571
if ( this . audioSourceNode ) {
2579
2572
this . controller . setTimeUpdateListenType ( AVMediaType . AVMEDIA_TYPE_AUDIO )
2580
2573
}
2581
- if ( this . video ) {
2582
- this . video . muted = false
2583
- }
2584
2574
this . fire ( eventType . AUDIO_CONTEXT_RUNNING )
2585
2575
}
2586
2576
}
2587
2577
if ( this . video ) {
2588
2578
this . video . muted = false
2589
- if ( ! this . video . played ) {
2579
+ if ( this . video . paused ) {
2590
2580
await this . video . play ( )
2591
2581
}
2592
2582
}
2593
2583
else if ( this . audio ) {
2594
2584
this . audio . muted = false
2595
- if ( ! this . audio . played ) {
2585
+ if ( this . audio . paused ) {
2596
2586
await this . audio . play ( )
2597
2587
}
2598
2588
}
You can’t perform that action at this time.
0 commit comments