Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,18 @@ m3uParser.prototype.parse = function parse(line) {
this.linesRead++;
return true;
}
if (['', '#EXT-X-ENDLIST'].indexOf(line) > -1) return true;

if (!line) {
return true;
}

// If a m3u8 file has a #EXT-X-ENDLIST item, it is a VOD, so we change its playlist type to VOD. Otherwise, this item
// is missing from the output m3u8 file, and players might think that a video is a LIVE-STREAM even if it is not...
if (line === '#EXT-X-ENDLIST') {
this.m3u.set('playlistType', 'VOD');
return true;
}

if (line.indexOf('#') == 0) {
this.parseLine(line);
} else {
Expand Down