Skip to content

Commit

Permalink
Add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
John Bartos committed Dec 5, 2016
1 parent 269ee07 commit 708d6d2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/unit/loader/playlist-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -563,3 +563,17 @@ Rollover38803/20160525T064049-01-69844069.ts
assert.strictEqual(result.fragments[2].programDateTime.getTime(), 1464366904000);
});
});


it('parses #EXTINF without a leading digit', () => {
var level = `#EXTM3U
#EXT-X-VERSION:3
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-TARGETDURATION:14
#EXTINF:.360,
/sec(3ae40f708f79ca9471f52b86da76a3a8)/frag(1)/video/107/282/158282701_mp4_h264_aac_hq.ts
#EXT-X-ENDLIST`;
var result = new PlaylistLoader({on : function() { }}).parseLevelPlaylist(level, 'http://proxy-62.dailymotion.com/sec(3ae40f708f79ca9471f52b86da76a3a8)/video/107/282/158282701_mp4_h264_aac_hq.m3u8#cell=core',0);
assert.strictEqual(result.fragments.length, 1);
assert.strictEqual(result.fragments[0].duration, 0.360);
});

0 comments on commit 708d6d2

Please sign in to comment.