diff --git a/parser.js b/parser.js index d4d3f4d..03515f0 100644 --- a/parser.js +++ b/parser.js @@ -91,6 +91,10 @@ m3uParser.prototype['EXT-X-BYTERANGE'] = function parseByteRange(data) { this.currentItem.set('byteRange', data); }; +m3uParser.prototype['EXT-X-PROGRAM-DATE-TIME'] = function parseProgramDateTime(data) { + this.currentItem.set('date', data); +}; + m3uParser.prototype['EXT-X-STREAM-INF'] = function(data) { this.addItem(new StreamItem(this.parseAttributes(data))); }; diff --git a/test/parser.test.js b/test/parser.test.js index 4ffda67..ab1d4e6 100644 --- a/test/parser.test.js +++ b/test/parser.test.js @@ -69,6 +69,17 @@ describe('parser', function() { }); }); + describe('#EXT-X-PROGRAM-DATE-TIME', function() { + it('should set date on currentItem', function() { + var parser = getParser(); + var programDateTime = '2017-03-23T19:26:41.000+0000'; + + parser.EXTINF('4.5,'); + parser['EXT-X-PROGRAM-DATE-TIME'](programDateTime); + parser.currentItem.get('date').should.eql(programDateTime); + }); + }); + describe('#EXT-X-DISCONTINUITY', function() { it('should indicate discontinuation on subsequent playlist item', function() { var parser = getParser();