From 1dbb003b505df17a1f1007dc3d8bcc934aca061e Mon Sep 17 00:00:00 2001 From: brandonocasey Date: Mon, 13 Sep 2021 16:43:29 -0400 Subject: [PATCH 1/5] fix: use URL to add searchParams for LLHLS --- src/playlist-loader.js | 32 ++++++++++++++++++++--------- test/playlist-loader.test.js | 40 +++++++++++++++++++++++++++++++++--- 2 files changed, 59 insertions(+), 13 deletions(-) diff --git a/src/playlist-loader.js b/src/playlist-loader.js index 1314b297a..b6832cb32 100644 --- a/src/playlist-loader.js +++ b/src/playlist-loader.js @@ -21,12 +21,13 @@ import {getKnownPartCount} from './playlist.js'; const { mergeOptions, EventTarget } = videojs; const addLLHLSQueryDirectives = (uri, media) => { - if (media.endList) { + if (media.endList || !media.serverControl) { return uri; } - const query = []; - if (media.serverControl && media.serverControl.canBlockReload) { + const parameters = {}; + + if (media.serverControl.canBlockReload) { const {preloadSegment} = media; // next msn is a zero based value, length is not. let nextMSN = media.mediaSequence + media.segments.length; @@ -44,7 +45,8 @@ const addLLHLSQueryDirectives = (uri, media) => { // and we need to add the _HLS_part= query if (nextPart > -1 && nextPart !== (parts.length - 1)) { // add existing parts to our preload hints - query.push(`_HLS_part=${nextPart}`); + // eslint-disable-next-line + parameters._HLS_part = nextPart; } // this if statement makes sure that we request the msn @@ -62,19 +64,29 @@ const addLLHLSQueryDirectives = (uri, media) => { } // add _HLS_msn= in front of any _HLS_part query - query.unshift(`_HLS_msn=${nextMSN}`); + // eslint-disable-next-line + parameters._HLS_msn = nextMSN; } if (media.serverControl && media.serverControl.canSkipUntil) { // add _HLS_skip= infront of all other queries. - query.unshift('_HLS_skip=' + (media.serverControl.canSkipDateranges ? 'v2' : 'YES')); + // eslint-disable-next-line + parameters._HLS_skip = (media.serverControl.canSkipDateranges ? 'v2' : 'YES'); } - query.forEach(function(str, i) { - const symbol = i === 0 ? '?' : '&'; + if (Object.keys(parameters).length) { + const parsedUri = new window.URL(uri); - uri += `${symbol}${str}`; - }); + ['_HLS_skip', '_HLS_msn', '_HLS_part'].forEach(function(name) { + if (!parameters.hasOwnProperty(name)) { + return; + } + + parsedUri.searchParams.set(name, parameters[name]); + }); + + uri = parsedUri.toString(); + } return uri; }; diff --git a/test/playlist-loader.test.js b/test/playlist-loader.test.js index bf806bed5..c3b0ff9f0 100644 --- a/test/playlist-loader.test.js +++ b/test/playlist-loader.test.js @@ -686,16 +686,15 @@ QUnit.module('Playlist Loader', function(hooks) { QUnit.test('can delay load', function(assert) { const loader = new PlaylistLoader('master.m3u8', this.fakeVhs); - assert.notOk(loader.mediaUpdateTimeout, 'no media update timeout'); + assert.false(loader.mediaUpdateTimeout, 'no media update timeout'); loader.load(true); - assert.ok(loader.mediaUpdateTimeout, 'have a media update timeout now'); + assert.true(loader.mediaUpdateTimeout, 'have a media update timeout now'); assert.strictEqual(this.requests.length, 0, 'have no requests'); this.clock.tick(5000); - assert.notOk(loader.mediaUpdateTimeout, 'media update timeout is gone'); assert.strictEqual(this.requests.length, 1, 'playlist request after delay'); }); @@ -2560,4 +2559,39 @@ QUnit.module('Playlist Loader', function(hooks) { assert.equal(this.requests[0].uri, 'http://example.com/media.m3u8?_HLS_skip=YES&_HLS_msn=8&_HLS_part=1'); }); + + QUnit.test('works with existing query directives', function(assert) { + this.loader.src += '?foo=test'; + this.requests.shift().respond( + 200, null, + '#EXTM3U\n' + + '#EXT-X-PART-INF:PART-TARGET=1\n' + + '#EXT-X-MEDIA-SEQUENCE:0\n' + + '#EXT-X-SERVER-CONTROL:CAN-BLOCK-RELOAD=YES,CAN-SKIP-UNTIL=3\n' + + '#EXTINF:2\n' + + 'segment0.ts\n' + + '#EXTINF:2\n' + + 'segment1.ts\n' + + '#EXTINF:2\n' + + 'segment2.ts\n' + + '#EXTINF:2\n' + + 'segment3.ts\n' + + '#EXTINF:2\n' + + 'segment4.ts\n' + + '#EXTINF:2\n' + + 'segment5.ts\n' + + '#EXT-X-PART:URI="segment6-part1.ts",DURATION=1\n' + + '#EXT-X-PART:URI="segment6-part2.ts",DURATION=1\n' + + 'segment6.ts\n' + + '#EXT-X-PART:URI="segment7-part1.ts",DURATION=1\n' + + '#EXT-X-PART:URI="segment7-part2.ts",DURATION=1\n' + + 'segment7.ts\n' + + '#EXT-X-PART:URI="segment8-part1.ts",DURATION=1\n' + + '#EXT-X-PRELOAD-HINT:TYPE="PART",URI="segment8-part2.ts"\n' + ); + + this.loader.trigger('mediaupdatetimeout'); + + assert.equal(this.requests[0].uri, 'http://example.com/media.m3u8?foo=test&_HLS_skip=YES&_HLS_msn=8&_HLS_part=1'); + }); }); From c53ce9db34d8210413cc06b3d98c1846b400a0b1 Mon Sep 17 00:00:00 2001 From: brandonocasey Date: Mon, 13 Sep 2021 16:47:02 -0400 Subject: [PATCH 2/5] no llhls on ie 11 --- src/playlist-loader.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/playlist-loader.js b/src/playlist-loader.js index b6832cb32..07bab9e7d 100644 --- a/src/playlist-loader.js +++ b/src/playlist-loader.js @@ -397,6 +397,11 @@ export default class PlaylistLoader extends EventTarget { this.customTagMappers = (vhsOptions && vhsOptions.customTagMappers) || []; this.experimentalLLHLS = (vhsOptions && vhsOptions.experimentalLLHLS) || false; + // force experimentalLLHLS for IE 11 + if (videojs.browser.IE_VERSION) { + this.experimentalLLHLS = false; + } + // initialize the loader state this.state = 'HAVE_NOTHING'; From d6406974a91345b58068259e2249f85435d45643 Mon Sep 17 00:00:00 2001 From: brandonocasey Date: Tue, 14 Sep 2021 13:51:22 -0400 Subject: [PATCH 3/5] ie 11 test fixes --- test/playlist-loader.test.js | 787 ++++++++++++++++++----------------- test/playlist.test.js | 85 ++-- 2 files changed, 439 insertions(+), 433 deletions(-) diff --git a/test/playlist-loader.test.js b/test/playlist-loader.test.js index c3b0ff9f0..e501e69aa 100644 --- a/test/playlist-loader.test.js +++ b/test/playlist-loader.test.js @@ -1,4 +1,5 @@ import QUnit from 'qunit'; +import videojs from 'video.js'; import { default as PlaylistLoader, updateSegments, @@ -686,11 +687,11 @@ QUnit.module('Playlist Loader', function(hooks) { QUnit.test('can delay load', function(assert) { const loader = new PlaylistLoader('master.m3u8', this.fakeVhs); - assert.false(loader.mediaUpdateTimeout, 'no media update timeout'); + assert.notOk(loader.mediaUpdateTimeout, 'no media update timeout'); loader.load(true); - assert.true(loader.mediaUpdateTimeout, 'have a media update timeout now'); + assert.ok(loader.mediaUpdateTimeout, 'have a media update timeout now'); assert.strictEqual(this.requests.length, 0, 'have no requests'); this.clock.tick(5000); @@ -2172,426 +2173,428 @@ QUnit.module('Playlist Loader', function(hooks) { assert.equal(this.requests.length, 1, 'playlist re-requested'); }); - QUnit.module('llhls', { - beforeEach() { - this.fakeVhs.options_ = {experimentalLLHLS: true}; - this.loader = new PlaylistLoader('http://example.com/media.m3u8', this.fakeVhs); + if (!videojs.browser.IE_VERSION) { + QUnit.module('llhls', { + beforeEach() { + this.fakeVhs.options_ = {experimentalLLHLS: true}; + this.loader = new PlaylistLoader('http://example.com/media.m3u8', this.fakeVhs); - this.loader.load(); + this.loader.load(); - }, - afterEach() { - this.loader.dispose(); - } - }); + }, + afterEach() { + this.loader.dispose(); + } + }); - QUnit.test('#EXT-X-SKIP does not add initial empty segments', function(assert) { - this.requests.shift().respond( - 200, null, - '#EXTM3U\n' + - '#EXT-X-MEDIA-SEQUENCE:0\n' + - '#EXT-X-SKIP:SKIPPED-SEGMENTS=10\n' + - '#EXTINF:2\n' + - 'low-1.ts\n' - ); - assert.equal(this.loader.media().segments.length, 1, 'only 1 segment'); - }); + QUnit.test('#EXT-X-SKIP does not add initial empty segments', function(assert) { + this.requests.shift().respond( + 200, null, + '#EXTM3U\n' + + '#EXT-X-MEDIA-SEQUENCE:0\n' + + '#EXT-X-SKIP:SKIPPED-SEGMENTS=10\n' + + '#EXTINF:2\n' + + 'low-1.ts\n' + ); + assert.equal(this.loader.media().segments.length, 1, 'only 1 segment'); + }); - QUnit.test('#EXT-X-SKIP merges skipped segments', function(assert) { - let playlist = - '#EXTM3U\n' + - '#EXT-X-MEDIA-SEQUENCE:0\n'; + QUnit.test('#EXT-X-SKIP merges skipped segments', function(assert) { + let playlist = + '#EXTM3U\n' + + '#EXT-X-MEDIA-SEQUENCE:0\n'; - for (let i = 0; i < 10; i++) { - playlist += '#EXTINF:2\n'; - playlist += `segment-${i}.ts\n`; - } + for (let i = 0; i < 10; i++) { + playlist += '#EXTINF:2\n'; + playlist += `segment-${i}.ts\n`; + } - this.requests.shift().respond(200, null, playlist); - assert.equal(this.loader.media().segments.length, 10, '10 segments'); + this.requests.shift().respond(200, null, playlist); + assert.equal(this.loader.media().segments.length, 10, '10 segments'); - this.loader.trigger('mediaupdatetimeout'); + this.loader.trigger('mediaupdatetimeout'); - const skippedPlaylist = - '#EXTM3U\n' + - '#EXT-X-MEDIA-SEQUENCE:0\n' + - '#EXT-X-SKIP:SKIPPED-SEGMENTS=10\n' + - '#EXTINF:2\n' + - 'segment-10.ts\n'; + const skippedPlaylist = + '#EXTM3U\n' + + '#EXT-X-MEDIA-SEQUENCE:0\n' + + '#EXT-X-SKIP:SKIPPED-SEGMENTS=10\n' + + '#EXTINF:2\n' + + 'segment-10.ts\n'; - this.requests.shift().respond(200, null, skippedPlaylist); + this.requests.shift().respond(200, null, skippedPlaylist); - assert.equal(this.loader.media().segments.length, 11, '11 segments'); + assert.equal(this.loader.media().segments.length, 11, '11 segments'); - this.loader.media().segments.forEach(function(s, i) { - if (i < 10) { - assert.ok(s.hasOwnProperty('skipped'), 'has skipped property'); - assert.false(s.skipped, 'skipped property is false'); - } + this.loader.media().segments.forEach(function(s, i) { + if (i < 10) { + assert.ok(s.hasOwnProperty('skipped'), 'has skipped property'); + assert.false(s.skipped, 'skipped property is false'); + } + + assert.equal(s.uri, `segment-${i}.ts`, 'segment uri as expected'); + }); + + this.loader.trigger('mediaupdatetimeout'); + + const skippedPlaylist2 = + '#EXTM3U\n' + + '#EXT-X-MEDIA-SEQUENCE:1\n' + + '#EXT-X-SKIP:SKIPPED-SEGMENTS=10\n' + + '#EXTINF:2\n' + + 'segment-11.ts\n'; + + this.requests.shift().respond(200, null, skippedPlaylist2); + + this.loader.media().segments.forEach(function(s, i) { + if (i < 10) { + assert.ok(s.hasOwnProperty('skipped'), 'has skipped property'); + assert.false(s.skipped, 'skipped property is false'); + } - assert.equal(s.uri, `segment-${i}.ts`, 'segment uri as expected'); + assert.equal(s.uri, `segment-${i + 1}.ts`, 'segment uri as expected'); + }); }); - this.loader.trigger('mediaupdatetimeout'); + QUnit.test('#EXT-X-PRELOAD with parts to added to segment list', function(assert) { + this.requests.shift().respond( + 200, null, + '#EXTM3U\n' + + '#EXT-X-PART-INF:PART-TARGET=1\n' + + '#EXT-X-MEDIA-SEQUENCE:0\n' + + '#EXTINF:2\n' + + 'low-1.ts\n' + + '#EXT-X-PART:URI="part1.ts",DURATION=1\n' + + '#EXT-X-PART:URI="part2.ts",DURATION=1\n' + ); + const media = this.loader.media(); - const skippedPlaylist2 = - '#EXTM3U\n' + - '#EXT-X-MEDIA-SEQUENCE:1\n' + - '#EXT-X-SKIP:SKIPPED-SEGMENTS=10\n' + - '#EXTINF:2\n' + - 'segment-11.ts\n'; + assert.equal(media.segments.length, 2, '2 segments'); + assert.deepEqual( + media.preloadSegment, + media.segments[media.segments.length - 1], + 'last segment is preloadSegment' + ); + }); - this.requests.shift().respond(200, null, skippedPlaylist2); + QUnit.test('#EXT-X-PRELOAD without parts not added to segment list', function(assert) { + this.requests.shift().respond( + 200, null, + '#EXTM3U\n' + + '#EXT-X-PART-INF:PART-TARGET=1\n' + + '#EXT-X-MEDIA-SEQUENCE:0\n' + + '#EXTINF:2\n' + + 'low-1.ts\n' + + '#EXT-X-PRELOAD-HINT:TYPE="PART",URI="part1.ts"\n' + ); + const media = this.loader.media(); - this.loader.media().segments.forEach(function(s, i) { - if (i < 10) { - assert.ok(s.hasOwnProperty('skipped'), 'has skipped property'); - assert.false(s.skipped, 'skipped property is false'); - } + assert.equal(media.segments.length, 1, '1 segment'); + assert.notDeepEqual( + media.preloadSegment, + media.segments[media.segments.length - 1], + 'last segment is not preloadSegment' + ); + }); - assert.equal(s.uri, `segment-${i + 1}.ts`, 'segment uri as expected'); + QUnit.test('#EXT-X-PART added to segments', function(assert) { + this.requests.shift().respond( + 200, null, + '#EXTM3U\n' + + '#EXT-X-PART-INF:PART-TARGET=1\n' + + '#EXT-X-MEDIA-SEQUENCE:0\n' + + '#EXTINF:2\n' + + 'segment0.ts\n' + + '#EXT-X-PART:URI="segment1-part1.ts",DURATION=1\n' + + '#EXT-X-PART:URI="segment1-part2.ts",DURATION=1\n' + + 'segment1.ts\n' + + '#EXT-X-PART:URI="segment2-part1.ts",DURATION=1\n' + + '#EXT-X-PART:URI="segment2-part2.ts",DURATION=1\n' + + 'segment2.ts\n' + + '#EXT-X-PART:URI="segment3-part1.ts",DURATION=1\n' + + '#EXT-X-PART:URI="segment3-part2.ts",DURATION=1\n' + + 'segment3.ts\n' + ); + const segments = this.loader.media().segments; + + assert.equal(segments.length, 4, '4 segments'); + assert.notOk(segments[0].parts, 'no parts for first segment'); + assert.equal(segments[1].parts.length, 2, 'parts for second segment'); + assert.equal(segments[2].parts.length, 2, 'parts for third segment'); + assert.equal(segments[3].parts.length, 2, 'parts for forth segment'); }); - }); - QUnit.test('#EXT-X-PRELOAD with parts to added to segment list', function(assert) { - this.requests.shift().respond( - 200, null, - '#EXTM3U\n' + - '#EXT-X-PART-INF:PART-TARGET=1\n' + - '#EXT-X-MEDIA-SEQUENCE:0\n' + - '#EXTINF:2\n' + - 'low-1.ts\n' + - '#EXT-X-PART:URI="part1.ts",DURATION=1\n' + - '#EXT-X-PART:URI="part2.ts",DURATION=1\n' - ); - const media = this.loader.media(); + QUnit.test('Adds _HLS_skip=YES to url when CAN-SKIP-UNTIL is set', function(assert) { + this.requests.shift().respond( + 200, null, + '#EXTM3U\n' + + '#EXT-X-PART-INF:PART-TARGET=1\n' + + '#EXT-X-MEDIA-SEQUENCE:0\n' + + '#EXT-X-SERVER-CONTROL:CAN-SKIP-UNTIL=3\n' + + '#EXTINF:2\n' + + 'segment0.ts\n' + + '#EXTINF:2\n' + + 'segment1.ts\n' + + '#EXTINF:2\n' + + 'segment2.ts\n' + + '#EXTINF:2\n' + + 'segment3.ts\n' + + '#EXTINF:2\n' + + 'segment4.ts\n' + + '#EXTINF:2\n' + + 'segment5.ts\n' + + '#EXT-X-PART:URI="segment6-part1.ts",DURATION=1\n' + + '#EXT-X-PART:URI="segment6-part2.ts",DURATION=1\n' + + 'segment6.ts\n' + + '#EXT-X-PART:URI="segment7-part1.ts",DURATION=1\n' + + '#EXT-X-PART:URI="segment7-part2.ts",DURATION=1\n' + + 'segment7.ts\n' + + '#EXT-X-PART:URI="segment8-part1.ts",DURATION=1\n' + + '#EXT-X-PART:URI="segment8-part2.ts",DURATION=1\n' + + 'segment8.ts\n' + ); - assert.equal(media.segments.length, 2, '2 segments'); - assert.deepEqual( - media.preloadSegment, - media.segments[media.segments.length - 1], - 'last segment is preloadSegment' - ); - }); + this.loader.trigger('mediaupdatetimeout'); - QUnit.test('#EXT-X-PRELOAD without parts not added to segment list', function(assert) { - this.requests.shift().respond( - 200, null, - '#EXTM3U\n' + - '#EXT-X-PART-INF:PART-TARGET=1\n' + - '#EXT-X-MEDIA-SEQUENCE:0\n' + - '#EXTINF:2\n' + - 'low-1.ts\n' + - '#EXT-X-PRELOAD-HINT:TYPE="PART",URI="part1.ts"\n' - ); - const media = this.loader.media(); + assert.equal(this.requests[0].uri, 'http://example.com/media.m3u8?_HLS_skip=YES'); + }); - assert.equal(media.segments.length, 1, '1 segment'); - assert.notDeepEqual( - media.preloadSegment, - media.segments[media.segments.length - 1], - 'last segment is not preloadSegment' - ); - }); + QUnit.test('Adds _HLS_skip=v2 to url when CAN-SKIP-UNTIL/CAN-SKIP-DATERANGES is set', function(assert) { + this.requests.shift().respond( + 200, null, + '#EXTM3U\n' + + '#EXT-X-PART-INF:PART-TARGET=1\n' + + '#EXT-X-MEDIA-SEQUENCE:0\n' + + '#EXT-X-SERVER-CONTROL:CAN-SKIP-UNTIL=3,CAN-SKIP-DATERANGES=YES\n' + + '#EXTINF:2\n' + + 'segment0.ts\n' + + '#EXTINF:2\n' + + 'segment1.ts\n' + + '#EXTINF:2\n' + + 'segment2.ts\n' + + '#EXTINF:2\n' + + 'segment3.ts\n' + + '#EXTINF:2\n' + + 'segment4.ts\n' + + '#EXTINF:2\n' + + 'segment5.ts\n' + + '#EXT-X-PART:URI="segment6-part1.ts",DURATION=1\n' + + '#EXT-X-PART:URI="segment6-part2.ts",DURATION=1\n' + + 'segment6.ts\n' + + '#EXT-X-PART:URI="segment7-part1.ts",DURATION=1\n' + + '#EXT-X-PART:URI="segment7-part2.ts",DURATION=1\n' + + 'segment7.ts\n' + + '#EXT-X-PART:URI="segment8-part1.ts",DURATION=1\n' + + '#EXT-X-PART:URI="segment8-part2.ts",DURATION=1\n' + + 'segment8.ts\n' + ); - QUnit.test('#EXT-X-PART added to segments', function(assert) { - this.requests.shift().respond( - 200, null, - '#EXTM3U\n' + - '#EXT-X-PART-INF:PART-TARGET=1\n' + - '#EXT-X-MEDIA-SEQUENCE:0\n' + - '#EXTINF:2\n' + - 'segment0.ts\n' + - '#EXT-X-PART:URI="segment1-part1.ts",DURATION=1\n' + - '#EXT-X-PART:URI="segment1-part2.ts",DURATION=1\n' + - 'segment1.ts\n' + - '#EXT-X-PART:URI="segment2-part1.ts",DURATION=1\n' + - '#EXT-X-PART:URI="segment2-part2.ts",DURATION=1\n' + - 'segment2.ts\n' + - '#EXT-X-PART:URI="segment3-part1.ts",DURATION=1\n' + - '#EXT-X-PART:URI="segment3-part2.ts",DURATION=1\n' + - 'segment3.ts\n' - ); - const segments = this.loader.media().segments; - - assert.equal(segments.length, 4, '4 segments'); - assert.notOk(segments[0].parts, 'no parts for first segment'); - assert.equal(segments[1].parts.length, 2, 'parts for second segment'); - assert.equal(segments[2].parts.length, 2, 'parts for third segment'); - assert.equal(segments[3].parts.length, 2, 'parts for forth segment'); - }); + this.loader.trigger('mediaupdatetimeout'); - QUnit.test('Adds _HLS_skip=YES to url when CAN-SKIP-UNTIL is set', function(assert) { - this.requests.shift().respond( - 200, null, - '#EXTM3U\n' + - '#EXT-X-PART-INF:PART-TARGET=1\n' + - '#EXT-X-MEDIA-SEQUENCE:0\n' + - '#EXT-X-SERVER-CONTROL:CAN-SKIP-UNTIL=3\n' + - '#EXTINF:2\n' + - 'segment0.ts\n' + - '#EXTINF:2\n' + - 'segment1.ts\n' + - '#EXTINF:2\n' + - 'segment2.ts\n' + - '#EXTINF:2\n' + - 'segment3.ts\n' + - '#EXTINF:2\n' + - 'segment4.ts\n' + - '#EXTINF:2\n' + - 'segment5.ts\n' + - '#EXT-X-PART:URI="segment6-part1.ts",DURATION=1\n' + - '#EXT-X-PART:URI="segment6-part2.ts",DURATION=1\n' + - 'segment6.ts\n' + - '#EXT-X-PART:URI="segment7-part1.ts",DURATION=1\n' + - '#EXT-X-PART:URI="segment7-part2.ts",DURATION=1\n' + - 'segment7.ts\n' + - '#EXT-X-PART:URI="segment8-part1.ts",DURATION=1\n' + - '#EXT-X-PART:URI="segment8-part2.ts",DURATION=1\n' + - 'segment8.ts\n' - ); - - this.loader.trigger('mediaupdatetimeout'); - - assert.equal(this.requests[0].uri, 'http://example.com/media.m3u8?_HLS_skip=YES'); - }); + assert.equal(this.requests[0].uri, 'http://example.com/media.m3u8?_HLS_skip=v2'); + }); - QUnit.test('Adds _HLS_skip=v2 to url when CAN-SKIP-UNTIL/CAN-SKIP-DATERANGES is set', function(assert) { - this.requests.shift().respond( - 200, null, - '#EXTM3U\n' + - '#EXT-X-PART-INF:PART-TARGET=1\n' + - '#EXT-X-MEDIA-SEQUENCE:0\n' + - '#EXT-X-SERVER-CONTROL:CAN-SKIP-UNTIL=3,CAN-SKIP-DATERANGES=YES\n' + - '#EXTINF:2\n' + - 'segment0.ts\n' + - '#EXTINF:2\n' + - 'segment1.ts\n' + - '#EXTINF:2\n' + - 'segment2.ts\n' + - '#EXTINF:2\n' + - 'segment3.ts\n' + - '#EXTINF:2\n' + - 'segment4.ts\n' + - '#EXTINF:2\n' + - 'segment5.ts\n' + - '#EXT-X-PART:URI="segment6-part1.ts",DURATION=1\n' + - '#EXT-X-PART:URI="segment6-part2.ts",DURATION=1\n' + - 'segment6.ts\n' + - '#EXT-X-PART:URI="segment7-part1.ts",DURATION=1\n' + - '#EXT-X-PART:URI="segment7-part2.ts",DURATION=1\n' + - 'segment7.ts\n' + - '#EXT-X-PART:URI="segment8-part1.ts",DURATION=1\n' + - '#EXT-X-PART:URI="segment8-part2.ts",DURATION=1\n' + - 'segment8.ts\n' - ); - - this.loader.trigger('mediaupdatetimeout'); - - assert.equal(this.requests[0].uri, 'http://example.com/media.m3u8?_HLS_skip=v2'); - }); + QUnit.test('Adds _HLS_part= and _HLS_msn= when we have a part preload hints and parts', function(assert) { + this.requests.shift().respond( + 200, null, + '#EXTM3U\n' + + '#EXT-X-PART-INF:PART-TARGET=1\n' + + '#EXT-X-MEDIA-SEQUENCE:0\n' + + '#EXT-X-SERVER-CONTROL:CAN-BLOCK-RELOAD=YES\n' + + '#EXTINF:2\n' + + 'segment0.ts\n' + + '#EXTINF:2\n' + + 'segment1.ts\n' + + '#EXTINF:2\n' + + 'segment2.ts\n' + + '#EXTINF:2\n' + + 'segment3.ts\n' + + '#EXTINF:2\n' + + 'segment4.ts\n' + + '#EXTINF:2\n' + + 'segment5.ts\n' + + '#EXT-X-PART:URI="segment6-part1.ts",DURATION=1\n' + + '#EXT-X-PART:URI="segment6-part2.ts",DURATION=1\n' + + 'segment6.ts\n' + + '#EXT-X-PART:URI="segment7-part1.ts",DURATION=1\n' + + '#EXT-X-PART:URI="segment7-part2.ts",DURATION=1\n' + + 'segment7.ts\n' + + '#EXT-X-PART:URI="segment8-part1.ts",DURATION=1\n' + + '#EXT-X-PRELOAD-HINT:TYPE="PART",URI="segment8-part2.ts"\n' + ); - QUnit.test('Adds _HLS_part= and _HLS_msn= when we have a part preload hints and parts', function(assert) { - this.requests.shift().respond( - 200, null, - '#EXTM3U\n' + - '#EXT-X-PART-INF:PART-TARGET=1\n' + - '#EXT-X-MEDIA-SEQUENCE:0\n' + - '#EXT-X-SERVER-CONTROL:CAN-BLOCK-RELOAD=YES\n' + - '#EXTINF:2\n' + - 'segment0.ts\n' + - '#EXTINF:2\n' + - 'segment1.ts\n' + - '#EXTINF:2\n' + - 'segment2.ts\n' + - '#EXTINF:2\n' + - 'segment3.ts\n' + - '#EXTINF:2\n' + - 'segment4.ts\n' + - '#EXTINF:2\n' + - 'segment5.ts\n' + - '#EXT-X-PART:URI="segment6-part1.ts",DURATION=1\n' + - '#EXT-X-PART:URI="segment6-part2.ts",DURATION=1\n' + - 'segment6.ts\n' + - '#EXT-X-PART:URI="segment7-part1.ts",DURATION=1\n' + - '#EXT-X-PART:URI="segment7-part2.ts",DURATION=1\n' + - 'segment7.ts\n' + - '#EXT-X-PART:URI="segment8-part1.ts",DURATION=1\n' + - '#EXT-X-PRELOAD-HINT:TYPE="PART",URI="segment8-part2.ts"\n' - ); - - this.loader.trigger('mediaupdatetimeout'); - - assert.equal(this.requests[0].uri, 'http://example.com/media.m3u8?_HLS_msn=8&_HLS_part=1'); - }); + this.loader.trigger('mediaupdatetimeout'); - QUnit.test('Adds _HLS_part= and _HLS_msn= when we have only a part preload hint', function(assert) { - this.requests.shift().respond( - 200, null, - '#EXTM3U\n' + - '#EXT-X-PART-INF:PART-TARGET=1\n' + - '#EXT-X-MEDIA-SEQUENCE:0\n' + - '#EXT-X-SERVER-CONTROL:CAN-BLOCK-RELOAD=YES\n' + - '#EXTINF:2\n' + - 'segment0.ts\n' + - '#EXTINF:2\n' + - 'segment1.ts\n' + - '#EXTINF:2\n' + - 'segment2.ts\n' + - '#EXTINF:2\n' + - 'segment3.ts\n' + - '#EXTINF:2\n' + - 'segment4.ts\n' + - '#EXTINF:2\n' + - 'segment5.ts\n' + - '#EXT-X-PART:URI="segment6-part1.ts",DURATION=1\n' + - '#EXT-X-PART:URI="segment6-part2.ts",DURATION=1\n' + - 'segment6.ts\n' + - '#EXT-X-PART:URI="segment7-part1.ts",DURATION=1\n' + - '#EXT-X-PART:URI="segment7-part2.ts",DURATION=1\n' + - 'segment7.ts\n' + - '#EXT-X-PRELOAD-HINT:TYPE="PART",URI="segment8-part1.ts"\n' - ); - - this.loader.trigger('mediaupdatetimeout'); - - assert.equal(this.requests[0].uri, 'http://example.com/media.m3u8?_HLS_msn=7&_HLS_part=0'); - }); + assert.equal(this.requests[0].uri, 'http://example.com/media.m3u8?_HLS_msn=8&_HLS_part=1'); + }); - QUnit.test('does not add _HLS_part= when we have only a preload parts without preload hints', function(assert) { - this.requests.shift().respond( - 200, null, - '#EXTM3U\n' + - '#EXT-X-PART-INF:PART-TARGET=1\n' + - '#EXT-X-MEDIA-SEQUENCE:0\n' + - '#EXT-X-SERVER-CONTROL:CAN-BLOCK-RELOAD=YES\n' + - '#EXTINF:2\n' + - 'segment0.ts\n' + - '#EXTINF:2\n' + - 'segment1.ts\n' + - '#EXTINF:2\n' + - 'segment2.ts\n' + - '#EXTINF:2\n' + - 'segment3.ts\n' + - '#EXTINF:2\n' + - 'segment4.ts\n' + - '#EXTINF:2\n' + - 'segment5.ts\n' + - '#EXT-X-PART:URI="segment6-part1.ts",DURATION=1\n' + - '#EXT-X-PART:URI="segment6-part2.ts",DURATION=1\n' + - 'segment6.ts\n' + - '#EXT-X-PART:URI="segment7-part1.ts",DURATION=1\n' + - '#EXT-X-PART:URI="segment7-part2.ts",DURATION=1\n' + - 'segment7.ts\n' + - '#EXT-X-PART:URI="segment8-part1.ts",DURATION=1\n' - ); - - this.loader.trigger('mediaupdatetimeout'); - - assert.equal(this.requests[0].uri, 'http://example.com/media.m3u8?_HLS_msn=8'); - }); + QUnit.test('Adds _HLS_part= and _HLS_msn= when we have only a part preload hint', function(assert) { + this.requests.shift().respond( + 200, null, + '#EXTM3U\n' + + '#EXT-X-PART-INF:PART-TARGET=1\n' + + '#EXT-X-MEDIA-SEQUENCE:0\n' + + '#EXT-X-SERVER-CONTROL:CAN-BLOCK-RELOAD=YES\n' + + '#EXTINF:2\n' + + 'segment0.ts\n' + + '#EXTINF:2\n' + + 'segment1.ts\n' + + '#EXTINF:2\n' + + 'segment2.ts\n' + + '#EXTINF:2\n' + + 'segment3.ts\n' + + '#EXTINF:2\n' + + 'segment4.ts\n' + + '#EXTINF:2\n' + + 'segment5.ts\n' + + '#EXT-X-PART:URI="segment6-part1.ts",DURATION=1\n' + + '#EXT-X-PART:URI="segment6-part2.ts",DURATION=1\n' + + 'segment6.ts\n' + + '#EXT-X-PART:URI="segment7-part1.ts",DURATION=1\n' + + '#EXT-X-PART:URI="segment7-part2.ts",DURATION=1\n' + + 'segment7.ts\n' + + '#EXT-X-PRELOAD-HINT:TYPE="PART",URI="segment8-part1.ts"\n' + ); - QUnit.test('Adds only _HLS_msn= when we have segment info', function(assert) { - this.requests.shift().respond( - 200, null, - '#EXTM3U\n' + - '#EXT-X-PART-INF:PART-TARGET=1\n' + - '#EXT-X-MEDIA-SEQUENCE:0\n' + - '#EXT-X-SERVER-CONTROL:CAN-BLOCK-RELOAD=YES\n' + - '#EXTINF:2\n' + - 'segment0.ts\n' + - '#EXTINF:2\n' + - 'segment1.ts\n' + - '#EXTINF:2\n' + - 'segment2.ts\n' + - '#EXTINF:2\n' + - 'segment3.ts\n' + - '#EXTINF:2\n' + - 'segment4.ts\n' + - '#EXTINF:2\n' + - 'segment5.ts\n' + - '#EXT-X-PART:URI="segment6-part1.ts",DURATION=1\n' + - '#EXT-X-PART:URI="segment6-part2.ts",DURATION=1\n' + - 'segment6.ts\n' + - '#EXT-X-PART:URI="segment7-part1.ts",DURATION=1\n' + - '#EXT-X-PART:URI="segment7-part2.ts",DURATION=1\n' + - 'segment7.ts\n' + - '#EXT-X-PART:URI="segment8-part1.ts",DURATION=1\n' + - '#EXT-X-PART:URI="segment8-part2.ts",DURATION=1\n' + - 'segment8.ts\n' - ); - - this.loader.trigger('mediaupdatetimeout'); - - assert.equal(this.requests[0].uri, 'http://example.com/media.m3u8?_HLS_msn=9'); - }); + this.loader.trigger('mediaupdatetimeout'); - QUnit.test('can add all query directives', function(assert) { - this.requests.shift().respond( - 200, null, - '#EXTM3U\n' + - '#EXT-X-PART-INF:PART-TARGET=1\n' + - '#EXT-X-MEDIA-SEQUENCE:0\n' + - '#EXT-X-SERVER-CONTROL:CAN-BLOCK-RELOAD=YES,CAN-SKIP-UNTIL=3\n' + - '#EXTINF:2\n' + - 'segment0.ts\n' + - '#EXTINF:2\n' + - 'segment1.ts\n' + - '#EXTINF:2\n' + - 'segment2.ts\n' + - '#EXTINF:2\n' + - 'segment3.ts\n' + - '#EXTINF:2\n' + - 'segment4.ts\n' + - '#EXTINF:2\n' + - 'segment5.ts\n' + - '#EXT-X-PART:URI="segment6-part1.ts",DURATION=1\n' + - '#EXT-X-PART:URI="segment6-part2.ts",DURATION=1\n' + - 'segment6.ts\n' + - '#EXT-X-PART:URI="segment7-part1.ts",DURATION=1\n' + - '#EXT-X-PART:URI="segment7-part2.ts",DURATION=1\n' + - 'segment7.ts\n' + - '#EXT-X-PART:URI="segment8-part1.ts",DURATION=1\n' + - '#EXT-X-PRELOAD-HINT:TYPE="PART",URI="segment8-part2.ts"\n' - ); - - this.loader.trigger('mediaupdatetimeout'); - - assert.equal(this.requests[0].uri, 'http://example.com/media.m3u8?_HLS_skip=YES&_HLS_msn=8&_HLS_part=1'); - }); + assert.equal(this.requests[0].uri, 'http://example.com/media.m3u8?_HLS_msn=7&_HLS_part=0'); + }); - QUnit.test('works with existing query directives', function(assert) { - this.loader.src += '?foo=test'; - this.requests.shift().respond( - 200, null, - '#EXTM3U\n' + - '#EXT-X-PART-INF:PART-TARGET=1\n' + - '#EXT-X-MEDIA-SEQUENCE:0\n' + - '#EXT-X-SERVER-CONTROL:CAN-BLOCK-RELOAD=YES,CAN-SKIP-UNTIL=3\n' + - '#EXTINF:2\n' + - 'segment0.ts\n' + - '#EXTINF:2\n' + - 'segment1.ts\n' + - '#EXTINF:2\n' + - 'segment2.ts\n' + - '#EXTINF:2\n' + - 'segment3.ts\n' + - '#EXTINF:2\n' + - 'segment4.ts\n' + - '#EXTINF:2\n' + - 'segment5.ts\n' + - '#EXT-X-PART:URI="segment6-part1.ts",DURATION=1\n' + - '#EXT-X-PART:URI="segment6-part2.ts",DURATION=1\n' + - 'segment6.ts\n' + - '#EXT-X-PART:URI="segment7-part1.ts",DURATION=1\n' + - '#EXT-X-PART:URI="segment7-part2.ts",DURATION=1\n' + - 'segment7.ts\n' + - '#EXT-X-PART:URI="segment8-part1.ts",DURATION=1\n' + - '#EXT-X-PRELOAD-HINT:TYPE="PART",URI="segment8-part2.ts"\n' - ); - - this.loader.trigger('mediaupdatetimeout'); - - assert.equal(this.requests[0].uri, 'http://example.com/media.m3u8?foo=test&_HLS_skip=YES&_HLS_msn=8&_HLS_part=1'); - }); + QUnit.test('does not add _HLS_part= when we have only a preload parts without preload hints', function(assert) { + this.requests.shift().respond( + 200, null, + '#EXTM3U\n' + + '#EXT-X-PART-INF:PART-TARGET=1\n' + + '#EXT-X-MEDIA-SEQUENCE:0\n' + + '#EXT-X-SERVER-CONTROL:CAN-BLOCK-RELOAD=YES\n' + + '#EXTINF:2\n' + + 'segment0.ts\n' + + '#EXTINF:2\n' + + 'segment1.ts\n' + + '#EXTINF:2\n' + + 'segment2.ts\n' + + '#EXTINF:2\n' + + 'segment3.ts\n' + + '#EXTINF:2\n' + + 'segment4.ts\n' + + '#EXTINF:2\n' + + 'segment5.ts\n' + + '#EXT-X-PART:URI="segment6-part1.ts",DURATION=1\n' + + '#EXT-X-PART:URI="segment6-part2.ts",DURATION=1\n' + + 'segment6.ts\n' + + '#EXT-X-PART:URI="segment7-part1.ts",DURATION=1\n' + + '#EXT-X-PART:URI="segment7-part2.ts",DURATION=1\n' + + 'segment7.ts\n' + + '#EXT-X-PART:URI="segment8-part1.ts",DURATION=1\n' + ); + + this.loader.trigger('mediaupdatetimeout'); + + assert.equal(this.requests[0].uri, 'http://example.com/media.m3u8?_HLS_msn=8'); + }); + + QUnit.test('Adds only _HLS_msn= when we have segment info', function(assert) { + this.requests.shift().respond( + 200, null, + '#EXTM3U\n' + + '#EXT-X-PART-INF:PART-TARGET=1\n' + + '#EXT-X-MEDIA-SEQUENCE:0\n' + + '#EXT-X-SERVER-CONTROL:CAN-BLOCK-RELOAD=YES\n' + + '#EXTINF:2\n' + + 'segment0.ts\n' + + '#EXTINF:2\n' + + 'segment1.ts\n' + + '#EXTINF:2\n' + + 'segment2.ts\n' + + '#EXTINF:2\n' + + 'segment3.ts\n' + + '#EXTINF:2\n' + + 'segment4.ts\n' + + '#EXTINF:2\n' + + 'segment5.ts\n' + + '#EXT-X-PART:URI="segment6-part1.ts",DURATION=1\n' + + '#EXT-X-PART:URI="segment6-part2.ts",DURATION=1\n' + + 'segment6.ts\n' + + '#EXT-X-PART:URI="segment7-part1.ts",DURATION=1\n' + + '#EXT-X-PART:URI="segment7-part2.ts",DURATION=1\n' + + 'segment7.ts\n' + + '#EXT-X-PART:URI="segment8-part1.ts",DURATION=1\n' + + '#EXT-X-PART:URI="segment8-part2.ts",DURATION=1\n' + + 'segment8.ts\n' + ); + + this.loader.trigger('mediaupdatetimeout'); + + assert.equal(this.requests[0].uri, 'http://example.com/media.m3u8?_HLS_msn=9'); + }); + + QUnit.test('can add all query directives', function(assert) { + this.requests.shift().respond( + 200, null, + '#EXTM3U\n' + + '#EXT-X-PART-INF:PART-TARGET=1\n' + + '#EXT-X-MEDIA-SEQUENCE:0\n' + + '#EXT-X-SERVER-CONTROL:CAN-BLOCK-RELOAD=YES,CAN-SKIP-UNTIL=3\n' + + '#EXTINF:2\n' + + 'segment0.ts\n' + + '#EXTINF:2\n' + + 'segment1.ts\n' + + '#EXTINF:2\n' + + 'segment2.ts\n' + + '#EXTINF:2\n' + + 'segment3.ts\n' + + '#EXTINF:2\n' + + 'segment4.ts\n' + + '#EXTINF:2\n' + + 'segment5.ts\n' + + '#EXT-X-PART:URI="segment6-part1.ts",DURATION=1\n' + + '#EXT-X-PART:URI="segment6-part2.ts",DURATION=1\n' + + 'segment6.ts\n' + + '#EXT-X-PART:URI="segment7-part1.ts",DURATION=1\n' + + '#EXT-X-PART:URI="segment7-part2.ts",DURATION=1\n' + + 'segment7.ts\n' + + '#EXT-X-PART:URI="segment8-part1.ts",DURATION=1\n' + + '#EXT-X-PRELOAD-HINT:TYPE="PART",URI="segment8-part2.ts"\n' + ); + + this.loader.trigger('mediaupdatetimeout'); + + assert.equal(this.requests[0].uri, 'http://example.com/media.m3u8?_HLS_skip=YES&_HLS_msn=8&_HLS_part=1'); + }); + + QUnit.test('works with existing query directives', function(assert) { + this.loader.src += '?foo=test'; + this.requests.shift().respond( + 200, null, + '#EXTM3U\n' + + '#EXT-X-PART-INF:PART-TARGET=1\n' + + '#EXT-X-MEDIA-SEQUENCE:0\n' + + '#EXT-X-SERVER-CONTROL:CAN-BLOCK-RELOAD=YES,CAN-SKIP-UNTIL=3\n' + + '#EXTINF:2\n' + + 'segment0.ts\n' + + '#EXTINF:2\n' + + 'segment1.ts\n' + + '#EXTINF:2\n' + + 'segment2.ts\n' + + '#EXTINF:2\n' + + 'segment3.ts\n' + + '#EXTINF:2\n' + + 'segment4.ts\n' + + '#EXTINF:2\n' + + 'segment5.ts\n' + + '#EXT-X-PART:URI="segment6-part1.ts",DURATION=1\n' + + '#EXT-X-PART:URI="segment6-part2.ts",DURATION=1\n' + + 'segment6.ts\n' + + '#EXT-X-PART:URI="segment7-part1.ts",DURATION=1\n' + + '#EXT-X-PART:URI="segment7-part2.ts",DURATION=1\n' + + 'segment7.ts\n' + + '#EXT-X-PART:URI="segment8-part1.ts",DURATION=1\n' + + '#EXT-X-PRELOAD-HINT:TYPE="PART",URI="segment8-part2.ts"\n' + ); + + this.loader.trigger('mediaupdatetimeout'); + + assert.equal(this.requests[0].uri, 'http://example.com/media.m3u8?foo=test&_HLS_skip=YES&_HLS_msn=8&_HLS_part=1'); + }); + } }); diff --git a/test/playlist.test.js b/test/playlist.test.js index 824b40354..f33de9d13 100644 --- a/test/playlist.test.js +++ b/test/playlist.test.js @@ -2,6 +2,7 @@ import Playlist from '../src/playlist'; import PlaylistLoader from '../src/playlist-loader'; import QUnit from 'qunit'; import xhrFactory from '../src/xhr'; +import videojs from 'video.js'; import { useFakeEnvironment } from './test-helpers'; // needed for plugin registration import '../src/videojs-http-streaming'; @@ -1372,54 +1373,56 @@ QUnit.module('Playlist', function() { } ); - QUnit.test('can return a partIndex', function(assert) { - this.fakeVhs.options_ = {experimentalLLHLS: true}; - const loader = new PlaylistLoader('media.m3u8', this.fakeVhs); + if (!videojs.browser.IE_VERSION) { + QUnit.test('can return a partIndex', function(assert) { + this.fakeVhs.options_ = {experimentalLLHLS: true}; + const loader = new PlaylistLoader('media.m3u8', this.fakeVhs); - loader.load(); + loader.load(); - this.requests.shift().respond( - 200, null, - '#EXTM3U\n' + - '#EXT-X-MEDIA-SEQUENCE:1001\n' + - '#EXTINF:4,\n' + - '1001.ts\n' + - '#EXTINF:5,\n' + - '1002.ts\n' + - '#EXT-X-PART:URI="1003.part1.ts",DURATION=1\n' + - '#EXT-X-PART:URI="1003.part2.ts",DURATION=1\n' + - '#EXT-X-PART:URI="1003.part3.ts",DURATION=1\n' + - '#EXT-X-PRELOAD-HINT:TYPE="PART",URI="1003.part4.ts"\n' - ); + this.requests.shift().respond( + 200, null, + '#EXTM3U\n' + + '#EXT-X-MEDIA-SEQUENCE:1001\n' + + '#EXTINF:4,\n' + + '1001.ts\n' + + '#EXTINF:5,\n' + + '1002.ts\n' + + '#EXT-X-PART:URI="1003.part1.ts",DURATION=1\n' + + '#EXT-X-PART:URI="1003.part2.ts",DURATION=1\n' + + '#EXT-X-PART:URI="1003.part3.ts",DURATION=1\n' + + '#EXT-X-PRELOAD-HINT:TYPE="PART",URI="1003.part4.ts"\n' + ); - const media = loader.media(); + const media = loader.media(); - this.defaults = { - playlist: media, - currentTime: 0, - startingSegmentIndex: 0, - startingPartIndex: null, - startTime: 0 - }; + this.defaults = { + playlist: media, + currentTime: 0, + startingSegmentIndex: 0, + startingPartIndex: null, + startTime: 0 + }; - assert.deepEqual( - this.getMediaInfoForTime({currentTime: 10, startTime: 0}), - {segmentIndex: 2, startTime: 9, partIndex: 0}, - 'returns expected part/segment' - ); + assert.deepEqual( + this.getMediaInfoForTime({currentTime: 10, startTime: 0}), + {segmentIndex: 2, startTime: 9, partIndex: 0}, + 'returns expected part/segment' + ); - assert.deepEqual( - this.getMediaInfoForTime({currentTime: 11, startTime: 0}), - {segmentIndex: 2, startTime: 10, partIndex: 1}, - 'returns expected part/segment' - ); + assert.deepEqual( + this.getMediaInfoForTime({currentTime: 11, startTime: 0}), + {segmentIndex: 2, startTime: 10, partIndex: 1}, + 'returns expected part/segment' + ); - assert.deepEqual( - this.getMediaInfoForTime({currentTime: 11, segmentIndex: -15}), - {segmentIndex: 2, startTime: 10, partIndex: 1}, - 'returns expected part/segment' - ); - }); + assert.deepEqual( + this.getMediaInfoForTime({currentTime: 11, segmentIndex: -15}), + {segmentIndex: 2, startTime: 10, partIndex: 1}, + 'returns expected part/segment' + ); + }); + } QUnit.test('liveEdgeDelay works as expected', function(assert) { const media = { From b3e6c5c00a2e3f48562a066ff046de0c3771a749 Mon Sep 17 00:00:00 2001 From: brandonocasey Date: Tue, 14 Sep 2021 15:09:54 -0400 Subject: [PATCH 4/5] more ie 11 fixes --- test/loader-common.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/loader-common.js b/test/loader-common.js index dc59433ee..9ad38517d 100644 --- a/test/loader-common.js +++ b/test/loader-common.js @@ -849,11 +849,12 @@ export const LoaderCommonFactory = ({ this.clock.tick(1); return Promise.resolve(); }).then(() => new Promise((resolve, reject) => { - loader.on('playlistupdate', () => { - this.clock.tick(1); - resolve(); - }); loader.on('trackinfo', () => { + loader.on('playlistupdate', () => { + this.clock.tick(1); + resolve(); + }); + loader.playlist(playlistWithDuration(50, { uri: 'bar-1080.m3u8', mediaSequence: 0, From f778f38c6486c4b3c0ecb323c430e6ec5cb3d01f Mon Sep 17 00:00:00 2001 From: brandonocasey Date: Wed, 15 Sep 2021 13:07:39 -0400 Subject: [PATCH 5/5] revert ie 11 fix, put in pr #1200 --- test/loader-common.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/loader-common.js b/test/loader-common.js index 9ad38517d..dc59433ee 100644 --- a/test/loader-common.js +++ b/test/loader-common.js @@ -849,12 +849,11 @@ export const LoaderCommonFactory = ({ this.clock.tick(1); return Promise.resolve(); }).then(() => new Promise((resolve, reject) => { + loader.on('playlistupdate', () => { + this.clock.tick(1); + resolve(); + }); loader.on('trackinfo', () => { - loader.on('playlistupdate', () => { - this.clock.tick(1); - resolve(); - }); - loader.playlist(playlistWithDuration(50, { uri: 'bar-1080.m3u8', mediaSequence: 0,