Detect video underrun and advance the current time.

This helps us avoid stalled video streams.
This commit is contained in:
Jeremy White 2016-12-19 15:14:06 -06:00
parent 001bcc830f
commit d83dc14e15
1 changed files with 8 additions and 0 deletions

View File

@ -1114,6 +1114,14 @@ function handle_append_video_buffer_done(e)
return;
}
if (stream.video.buffered.length > 0 &&
stream.video.currentTime < stream.video.buffered.start(stream.video.buffered.length - 1))
{
console.log("Video appears to have fallen behind; advancing to " +
stream.video.buffered.start(stream.video.buffered.length - 1));
stream.video.currentTime = stream.video.buffered.start(stream.video.buffered.length - 1);
}
if (STREAM_DEBUG > 1)
console.log(stream.video.currentTime + ":id " + stream.id + " updateend " + dump_media_element(stream.video));
}