9c47ba5b by jrivera

Start 3 segments from the end of the playlist instead of 3 target durations

1 parent 58b7c472
...@@ -141,8 +141,7 @@ ...@@ -141,8 +141,7 @@
141 // https://tools.ietf.org/html/draft-pantos-http-live-streaming-16#section-6.3.3 141 // https://tools.ietf.org/html/draft-pantos-http-live-streaming-16#section-6.3.3
142 start = intervalDuration(playlist, playlist.mediaSequence); 142 start = intervalDuration(playlist, playlist.mediaSequence);
143 end = intervalDuration(playlist, 143 end = intervalDuration(playlist,
144 playlist.mediaSequence + playlist.segments.length); 144 playlist.mediaSequence + Math.max(0, playlist.segments.length - 3));
145 end -= (playlist.targetDuration || DEFAULT_TARGET_DURATION) * 3;
146 end = Math.max(0, end); 145 end = Math.max(0, end);
147 return videojs.createTimeRange(start, end); 146 return videojs.createTimeRange(start, end);
148 }; 147 };
......
...@@ -381,8 +381,8 @@ ...@@ -381,8 +381,8 @@
381 }); 381 });
382 equal(seekable.start(0), 0, 'starts at the earliest available segment'); 382 equal(seekable.start(0), 0, 'starts at the earliest available segment');
383 equal(seekable.end(0), 383 equal(seekable.end(0),
384 9 - (2 * 3), 384 9 - (2 + 2 + 1),
385 'allows seeking no further than three target durations from the end'); 385 'allows seeking no further than three segments from the end');
386 }); 386 });
387 387
388 })(window, window.videojs); 388 })(window, window.videojs);
......