@@ -805,9 +805,17 @@ function StreamController() {
805805
806806 const playbackQuality = videoModel . getPlaybackQuality ( ) ;
807807
808+ if ( videoModel . isSeeking ( ) ) {
809+ totalVideoFramesAtLastPlaybackProgress = 0
810+ }
811+
812+ const isEnded = event . timeToEnd ? event . timeToEnd >= 0 : false ;
813+
808814 const isVideoFramesNotAdvancing = playbackQuality &&
809815 typeof playbackQuality . totalVideoFrames === 'number'
816+ && ! isEnded
810817 && timeAtLastPlaybackProgress !== 0
818+ && event . time > settings . get ( ) . streaming . buffer . videoFramesNotAdvancing . thresholdInSeconds // We should be at least one threshold into the video before triggering
811819 && ! videoModel . isPaused ( )
812820 && ! videoModel . isStalled ( )
813821 && videoModel . getReadyState ( ) >= Constants . VIDEO_ELEMENT_READY_STATES . HAVE_ENOUGH_DATA
@@ -818,7 +826,13 @@ function StreamController() {
818826
819827 if ( isVideoFramesNotAdvancing ) {
820828 if ( ( timeAtLastPlaybackProgress + settings . get ( ) . streaming . buffer . videoFramesNotAdvancing . thresholdInSeconds < event . time ) && ! videoFramesNotAdvancingTriggered ) {
821- eventBus . trigger ( Events . PLAYBACK_FROZEN , { cause :'Frames have stopped advancing, Chromium bug #41243192' , totalVideoFrames : playbackQuality . totalVideoFrames , time : event . time } ) ;
829+ eventBus . trigger ( Events . PLAYBACK_FROZEN , {
830+ cause :'Frames have stopped advancing, Chromium bug #41243192' ,
831+ totalVideoFrames : playbackQuality . totalVideoFrames ,
832+ mediaTime : event . time ,
833+ isEnded : videoModel . getEnded ( ) ,
834+ isSeeking : videoModel . isSeeking ( )
835+ } ) ;
822836 if ( settings . get ( ) . streaming . buffer . videoFramesNotAdvancing . enabled ) {
823837 logger . warn ( 'Video playback has frozen, attempting to recover by seeking to current time' )
824838 videoModel . setCurrentTime ( videoModel . getTime ( ) - 0.0001 , false )
0 commit comments