Skip to content

Commit

Permalink
stream-controller: use video.buffered.length attribute instead of vid…
Browse files Browse the repository at this point in the history
…eo.readyState>= HAVE_CURRENT_DATA

to determine whether video is expected to play

related to https://github.com/dailymotion/hls.js/issues/476
  • Loading branch information
mangui committed Jun 9, 2016
1 parent e9d2ddd commit 5c2af23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/controller/stream-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,7 @@ _checkBuffer() {
logger.log(`target seek position:${targetSeekPosition}`);
}
var bufferInfo = BufferHelper.bufferInfo(media,currentTime,0),
expectedPlaying = !(media.paused || media.ended || media.seeking || readyState < 2),
expectedPlaying = !(media.paused || media.ended || media.seeking || media.buffered.length === 0),
jumpThreshold = 0.4, // tolerance needed as some browsers stalls playback before reaching buffered range end
playheadMoving = currentTime > media.playbackRate*this.lastCurrentTime;

Expand Down

0 comments on commit 5c2af23

Please sign in to comment.