2e41348d by David LaPalomento

Make sure endOfStream is called

When the last segment in a playlist is appended, call endOfStream. There was an off-by-one error calculating when the final segment was delivered. Mock out endOfStream for test cases so exceptions aren't thrown. For #111. This commit stops the spinner from showing up when a video has finished but hitting play again to restart the video is not currently working.
1 parent a55fc47b
......@@ -533,7 +533,9 @@ var
// we're done processing this segment
segmentBuffer.shift();
if (mediaIndex === playlist.segments.length) {
// transition the sourcebuffer to the ended state if we've hit the end of
// the playlist
if (mediaIndex + 1 === playlist.segments.length) {
mediaSource.endOfStream();
}
};
......