920621a3 by bc-bbay

Changing the discontinuity seek to be a new test

As requested by @BCdmlap, changing the discontinuity seek to be a new
test instead of a modification to an existing test.
1 parent 18b4fb56
......@@ -1261,6 +1261,56 @@ test('clears the segment buffer on seek', function() {
standardXHRResponse(requests.pop());
// play to 6s to trigger the next segment request
currentTime = 6;
bufferEnd = 10;
player.trigger('timeupdate');
standardXHRResponse(requests.pop());
// seek back to the beginning
player.currentTime(0);
tags.push({ pts: 0, bytes: 0 });
standardXHRResponse(requests.pop());
strictEqual(aborts, 1, 'aborted once for the seek');
// the source buffer empties. is 2.ts still in the segment buffer?
player.trigger('waiting');
strictEqual(aborts, 1, 'cleared the segment buffer on a seek');
});
test('continues playing after seek to discontinuity', function() {
var aborts = 0, tags = [], currentTime, bufferEnd, oldCurrentTime;
videojs.Hls.SegmentParser = mockSegmentParser(tags);
player.src({
src: 'discontinuity.m3u8',
type: 'application/vnd.apple.mpegurl'
});
openMediaSource(player);
oldCurrentTime = player.currentTime;
player.currentTime = function(time) {
if (time !== undefined) {
return oldCurrentTime.call(player, time);
}
return currentTime;
};
player.buffered = function() {
return videojs.createTimeRange(0, bufferEnd);
};
player.hls.sourceBuffer.abort = function() {
aborts++;
};
requests.pop().respond(200, null,
'#EXTM3U\n' +
'#EXTINF:10,0\n' +
'1.ts\n' +
'#EXT-X-DISCONTINUITY\n' +
'#EXTINF:10,0\n' +
'2.ts\n');
standardXHRResponse(requests.pop());
currentTime = 1;
bufferEnd = 10;
player.trigger('timeupdate');
......