File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -304,14 +304,26 @@ shaka.media.GapJumpingController = class {
304
304
const threshold = this . config_ . stallThreshold ;
305
305
const skip = this . config_ . stallSkip ;
306
306
307
- const onStall = ( at , duration ) => {
307
+ const onStall = async ( at , duration ) => {
308
308
goog . asserts . assert ( this . video_ , 'Must have video' ) ;
309
+ const bufferedInfo =
310
+ shaka . media . TimeRangesUtils . getBufferedInfo ( this . video_ . buffered ) ;
311
+ if ( ! bufferedInfo . length ) {
312
+ // Nothing in the buffer.
313
+ return ;
314
+ }
309
315
shaka . log . debug ( `Stall detected at ${ at } for ${ duration } seconds.` ) ;
310
316
311
317
if ( skip ) {
312
318
shaka . log . debug ( `Seeking forward ${ skip } seconds to break stall.` ) ;
313
319
this . video_ . currentTime += skip ;
314
320
} else {
321
+ shaka . log . debug (
322
+ 'Wait for play to avoid reject a possible other play call.' ) ;
323
+ await this . video_ . play ( ) ;
324
+ if ( ! this . video_ ) {
325
+ return ;
326
+ }
315
327
shaka . log . debug ( 'Pausing and unpausing to break stall.' ) ;
316
328
this . video_ . pause ( ) ;
317
329
this . video_ . play ( ) ;
You can’t perform that action at this time.
0 commit comments