Browse Source
Basic support for master playlists
Basic support for master playlists
If a master playlist has been downloaded, immediately fetch the default variant playlist and start buffering it. This matches HLS network activity in Safari on OS X which also seems to lazily load the non-default variant streams. Consolidate relative URL resolution and use a solution involving the `base` element to take advantage of browser logic for URL composition. Update test cases to expect absolute URLs for XHRs after the initial manifest request.pull/80/head

8 changed files with 279 additions and 137 deletions
-
2src/m3u8/m3u8-parser.js
-
295src/videojs-hls.js
-
8test/fixtures/bipbop.m3u8
-
40test/manifest/brightcove.json
-
9test/manifest/brightcove.m3u8
-
8test/manifest/master.json
-
9test/manifest/master.m3u8
-
45test/videojs-hls_test.js
@ -1,3 +1,9 @@ |
|||
#EXTM3U |
|||
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=200000 |
|||
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=240000 |
|||
prog_index.m3u8 |
|||
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=40000 |
|||
prog_index1.m3u8 |
|||
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=440000 |
|||
prog_index2.m3u8 |
|||
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1928000 |
|||
prog_index3.m3u8 |
@ -0,0 +1,40 @@ |
|||
{ |
|||
"allowCache": true, |
|||
"playlists": [{ |
|||
"attributes": { |
|||
"PROGRAM-ID": 1, |
|||
"BANDWIDTH": 240000, |
|||
"RESOLUTION": { |
|||
"width": 396, |
|||
"height": 224 |
|||
} |
|||
}, |
|||
"uri": "http://c.brightcove.com/services/mobile/streaming/index/rendition.m3u8?assetId=1824686811001&videoId=1824650741001" |
|||
}, { |
|||
"attributes": { |
|||
"PROGRAM-ID": 1, |
|||
"BANDWIDTH": 40000 |
|||
}, |
|||
"uri": "http://c.brightcove.com/services/mobile/streaming/index/rendition.m3u8?assetId=1824683759001&videoId=1824650741001" |
|||
}, { |
|||
"attributes": { |
|||
"PROGRAM-ID": 1, |
|||
"BANDWIDTH": 440000, |
|||
"RESOLUTION": { |
|||
"width": 396, |
|||
"height": 224 |
|||
} |
|||
}, |
|||
"uri": "http://c.brightcove.com/services/mobile/streaming/index/rendition.m3u8?assetId=1824686593001&videoId=1824650741001" |
|||
}, { |
|||
"attributes": { |
|||
"PROGRAM-ID": 1, |
|||
"BANDWIDTH": 1928000, |
|||
"RESOLUTION": { |
|||
"width": 960, |
|||
"height": 540 |
|||
} |
|||
}, |
|||
"uri": "http://c.brightcove.com/services/mobile/streaming/index/rendition.m3u8?assetId=1824687660001&videoId=1824650741001" |
|||
}] |
|||
} |
@ -0,0 +1,9 @@ |
|||
#EXTM3U |
|||
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=240000,RESOLUTION=396x224 |
|||
http://c.brightcove.com/services/mobile/streaming/index/rendition.m3u8?assetId=1824686811001&videoId=1824650741001 |
|||
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=40000 |
|||
http://c.brightcove.com/services/mobile/streaming/index/rendition.m3u8?assetId=1824683759001&videoId=1824650741001 |
|||
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=440000,RESOLUTION=396x224 |
|||
http://c.brightcove.com/services/mobile/streaming/index/rendition.m3u8?assetId=1824686593001&videoId=1824650741001 |
|||
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1928000,RESOLUTION=960x540 |
|||
http://c.brightcove.com/services/mobile/streaming/index/rendition.m3u8?assetId=1824687660001&videoId=1824650741001 |
@ -1,9 +1,10 @@ |
|||
# A simple master playlist with multiple variant streams |
|||
#EXTM3U |
|||
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=240000,RESOLUTION=396x224 |
|||
http://c.brightcove.com/services/mobile/streaming/index/rendition.m3u8?assetId=1824686811001&videoId=1824650741001 |
|||
media.m3u8 |
|||
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=40000 |
|||
http://c.brightcove.com/services/mobile/streaming/index/rendition.m3u8?assetId=1824683759001&videoId=1824650741001 |
|||
media.m3u8 |
|||
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=440000,RESOLUTION=396x224 |
|||
http://c.brightcove.com/services/mobile/streaming/index/rendition.m3u8?assetId=1824686593001&videoId=1824650741001 |
|||
media.m3u8 |
|||
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1928000,RESOLUTION=960x540 |
|||
http://c.brightcove.com/services/mobile/streaming/index/rendition.m3u8?assetId=1824687660001&videoId=1824650741001 |
|||
media.m3u8 |
Write
Preview
Loading…
Cancel
Save
Reference in new issue