Skip to content
Snippets Groups Projects
Commit d83dc14e authored by Jeremy White's avatar Jeremy White
Browse files

Detect video underrun and advance the current time.

This helps us avoid stalled video streams.
parent 001bcc83
No related branches found
No related tags found
Loading
...@@ -1114,6 +1114,14 @@ function handle_append_video_buffer_done(e) ...@@ -1114,6 +1114,14 @@ function handle_append_video_buffer_done(e)
return; 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) if (STREAM_DEBUG > 1)
console.log(stream.video.currentTime + ":id " + stream.id + " updateend " + dump_media_element(stream.video)); console.log(stream.video.currentTime + ":id " + stream.id + " updateend " + dump_media_element(stream.video));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment