Skip to content

Commit

Permalink
test: add llhls manifests for incoming features (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonocasey authored Jan 20, 2021
1 parent 22dbb60 commit 0823ea8
Show file tree
Hide file tree
Showing 5 changed files with 225 additions and 15 deletions.
71 changes: 71 additions & 0 deletions test/fixtures/m3u8/llhls.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"allowCache": true,
"dateTimeObject": new Date("2019-02-14T02:13:36.106Z"),
"dateTimeString": "2019-02-14T02:13:36.106Z",
"discontinuitySequence": 0,
"discontinuityStarts": [],
"mediaSequence": 266,
"segments": [
{
"dateTimeObject": new Date("2019-02-14T02:13:36.106Z"),
"dateTimeString": "2019-02-14T02:13:36.106Z",
"duration": 4.00008,
"map": {
"uri": "init.mp4"
},
"timeline": 0,
"uri": "fileSequence266.mp4"
},
{
"duration": 4.00008,
"map": {
"uri": "init.mp4"
},
"timeline": 0,
"uri": "fileSequence267.mp4"
},
{
"duration": 4.00008,
"map": {
"uri": "init.mp4"
},
"timeline": 0,
"uri": "fileSequence268.mp4"
},
{
"duration": 4.00008,
"map": {
"uri": "init.mp4"
},
"timeline": 0,
"uri": "fileSequence269.mp4"
},
{
"duration": 4.00008,
"map": {
"uri": "init.mp4"
},
"timeline": 0,
"uri": "fileSequence270.mp4"
},
{
"duration": 4.00008,
"map": {
"uri": "init.mp4"
},
"timeline": 0,
"uri": "fileSequence271.mp4"
},
{
"dateTimeObject": new Date("2019-02-14T02:14:00.106Z"),
"dateTimeString": "2019-02-14T02:14:00.106Z",
"duration": 4.00008,
"map": {
"uri": "init.mp4"
},
"timeline": 0,
"uri": "fileSequence272.mp4"
}
],
"targetDuration": 4
}
56 changes: 56 additions & 0 deletions test/fixtures/m3u8/llhls.m3u8
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#EXTM3U
# This Playlist is a response to: GET https://example.com/2M/waitForMSN.php?_HLS_msn=273&_HLS_part=2
#EXT-X-TARGETDURATION:4
#EXT-X-VERSION:6
#EXT-X-SERVER-CONTROL:CAN-BLOCK-RELOAD=YES,CAN-SKIP-DATERANGES=YES,PART-HOLD-BACK=1.0,CAN-SKIP-UNTIL=12.0,HOLD-BACK=2.0
#EXT-X-PART-INF:PART-TARGET=0.33334
#EXT-X-MEDIA-SEQUENCE:266
#EXT-X-PROGRAM-DATE-TIME:2019-02-14T02:13:36.106Z
#EXT-X-MAP:URI="init.mp4"
#EXTINF:4.00008,
fileSequence266.mp4
#EXTINF:4.00008,
fileSequence267.mp4
#EXTINF:4.00008,
fileSequence268.mp4
#EXTINF:4.00008,
fileSequence269.mp4
#EXTINF:4.00008,
fileSequence270.mp4
#EXT-X-PART:DURATION=0.33334,URI="filePart271.0.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart271.1.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart271.2.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart271.3.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart271.4.mp4",INDEPENDENT=YES
#EXT-X-PART:DURATION=0.33334,URI="filePart271.5.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart271.6.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart271.7.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart271.8.mp4",INDEPENDENT=YES
#EXT-X-PART:DURATION=0.33334,URI="filePart271.9.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart271.10.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart271.11.mp4"
#EXTINF:4.00008,
fileSequence271.mp4
#EXT-X-PROGRAM-DATE-TIME:2019-02-14T02:14:00.106Z
#EXT-X-PART:DURATION=0.33334,URI="filePart272.a.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart272.b.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart272.c.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart272.d.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart272.e.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart272.f.mp4",INDEPENDENT=YES
#EXT-X-PART:DURATION=0.33334,URI="filePart272.g.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart272.h.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart272.i.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart272.j.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart272.k.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart272.l.mp4"
#EXTINF:4.00008,
fileSequence272.mp4
#EXT-X-PART:DURATION=0.33334,URI="filePart273.0.mp4",INDEPENDENT=YES
#EXT-X-PART:DURATION=0.33334,URI="filePart273.1.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart273.2.mp4"
#EXT-X-PRELOAD-HINT:TYPE=PART,URI="filePart273.3.mp4"
#EXT-X-PRELOAD-HINT:TYPE=PART,URI="filePart273.4.mp4"

#EXT-X-RENDITION-REPORT:URI="../1M/waitForMSN.php",LAST-MSN=273,LAST-PART=2
#EXT-X-RENDITION-REPORT:URI="../4M/waitForMSN.php",LAST-MSN=273,LAST-PART=1
33 changes: 33 additions & 0 deletions test/fixtures/m3u8/llhlsDelta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"allowCache": true,
"dateTimeObject": new Date("2019-02-14T02:14:00.106Z"),
"dateTimeString": "2019-02-14T02:14:00.106Z",
"discontinuitySequence": 0,
"discontinuityStarts": [],
"mediaSequence": 266,
"segments": [
{
"duration": 4.00008,
"timeline": 0,
"uri": "fileSequence269.mp4"
},
{
"duration": 4.00008,
"timeline": 0,
"uri": "fileSequence270.mp4"
},
{
"duration": 4.00008,
"timeline": 0,
"uri": "fileSequence271.mp4"
},
{
"dateTimeObject": new Date("2019-02-14T02:14:00.106Z"),
"dateTimeString": "2019-02-14T02:14:00.106Z",
"duration": 4.00008,
"timeline": 0,
"uri": "fileSequence272.mp4"
}
],
"targetDuration": 4
}
50 changes: 50 additions & 0 deletions test/fixtures/m3u8/llhlsDelta.m3u8
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#EXTM3U
# Following the example above, this Playlist is a response to: GET https://example.com/2M/waitForMSN.php?_HLS_msn=273&_HLS_part=3 &_HLS_skip=YES
#EXT-X-TARGETDURATION:4
#EXT-X-VERSION:9
#EXT-X-SERVER-CONTROL:CAN-BLOCK-RELOAD=YES,CAN-SKIP-DATERANGES=YES,PART-HOLD-BACK=1.0,CAN-SKIP-UNTIL=12.0,HOLD-BACK=2.0
#EXT-X-PART-INF:PART-TARGET=0.33334
#EXT-X-MEDIA-SEQUENCE:266
#EXT-X-SKIP:SKIPPED-SEGMENTS=3,RECENTLY-REMOVED-DATERANGES=foo bar
#EXTINF:4.00008,
fileSequence269.mp4
#EXTINF:4.00008,
fileSequence270.mp4
#EXT-X-PART:DURATION=0.33334,URI="filePart271.0.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart271.1.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart271.2.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart271.3.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart271.4.mp4",INDEPENDENT=YES
#EXT-X-PART:DURATION=0.33334,URI="filePart271.5.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart271.6.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart271.7.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart271.8.mp4",INDEPENDENT=YES
#EXT-X-PART:DURATION=0.33334,URI="filePart271.9.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart271.10.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart271.11.mp4"
#EXTINF:4.00008,
fileSequence271.mp4
#EXT-X-PROGRAM-DATE-TIME:2019-02-14T02:14:00.106Z
#EXT-X-PART:DURATION=0.33334,URI="filePart272.a.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart272.b.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart272.c.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart272.d.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart272.e.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart272.f.mp4",INDEPENDENT=YES
#EXT-X-PART:DURATION=0.33334,URI="filePart272.g.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart272.h.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart272.i.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart272.j.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart272.k.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart272.l.mp4"
#EXTINF:4.00008,
fileSequence272.mp4
#EXT-X-PART:DURATION=0.33334,URI="filePart273.0.mp4",INDEPENDENT=YES
#EXT-X-PART:DURATION=0.33334,URI="filePart273.1.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart273.2.mp4"
#EXT-X-PART:DURATION=0.33334,URI="filePart273.3.mp4"
#EXT-X-PRELOAD-HINT:TYPE=PART,URI="filePart273.4.mp4"
#EXT-X-PRELOAD-HINT:TYPE=PART,URI="filePart273.5.mp4"

#EXT-X-RENDITION-REPORT:URI="../1M/waitForMSN.php",LAST-MSN=273,LAST-PART=3
#EXT-X-RENDITION-REPORT:URI="../4M/waitForMSN.php",LAST-MSN=273,LAST-PART=3
30 changes: 15 additions & 15 deletions test/m3u8.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1392,19 +1392,19 @@ QUnit.test('byterange offset defaults to next byte', function(assert) {

QUnit.module('m3u8s');

QUnit.test('parses static manifests as expected', function(assert) {
let key;

for (key in testDataManifests) {
if (testDataExpected[key]) {
const parser = new Parser();

parser.push(testDataManifests[key]);
assert.deepEqual(
parser.manifest,
testDataExpected[key],
key + '.m3u8 was parsed correctly'
);
}
for (const key in testDataManifests) {
if (!testDataExpected[key]) {
continue;
}
});
QUnit.test(`parses ${key} as expected`, function(assert) {
const parser = new Parser();

parser.push(testDataManifests[key]);
assert.deepEqual(
parser.manifest,
testDataExpected[key],
key + '.m3u8 was parsed correctly'
);
});
}

0 comments on commit 0823ea8

Please sign in to comment.