Comparing version 0.0.3 to 0.0.4
@@ -88,3 +88,6 @@ var M3U = module.exports = function M3U() { | ||
output.push(this.items.PlaylistItem.map(itemToString).join('\n')); | ||
output.push('#EXT-X-ENDLIST\n'); | ||
if (this.get('playlistType') === 'VOD') { | ||
output.push('#EXT-X-ENDLIST'); | ||
} | ||
} else { | ||
@@ -153,2 +156,3 @@ if (this.items.StreamItem.length) { | ||
var propertyMap = [ | ||
{ tag: 'EXT-X-ALLOW-CACHE', key: 'allowCache' }, | ||
{ tag: 'EXT-X-I-FRAMES-ONLY', key: 'iframesOnly' }, | ||
@@ -155,0 +159,0 @@ { tag: 'EXT-X-MEDIA-SEQUENCE', key: 'mediaSequence' }, |
@@ -7,2 +7,3 @@ var AttributeList = require('./AttributeList'); | ||
byteRange : null, | ||
date : null, | ||
discontinuity : null, | ||
@@ -56,2 +57,2 @@ duration : null, | ||
return Object.keys(this.properties).indexOf(key) > -1; | ||
}; | ||
}; |
@@ -21,2 +21,9 @@ var util = require('util'), | ||
} | ||
if (this.get('date')) { | ||
var date = this.get('date'); | ||
if (date.getMonth) { | ||
date = date.toISOString(); | ||
} | ||
output.push('#EXT-X-PROGRAM-DATE-TIME:' + date); | ||
} | ||
if (this.get('duration') != null || this.get('title') != null) { | ||
@@ -33,2 +40,2 @@ output.push( | ||
return output.join('\n'); | ||
}; | ||
}; |
{ | ||
"name" : "m3u8", | ||
"version" : "0.0.3", | ||
"version" : "0.0.4", | ||
"description" : "streaming m3u8 parser for Apple's HTTP Live Streaming protocol", | ||
@@ -5,0 +5,0 @@ "main" : "./parser.js", |
@@ -104,3 +104,3 @@ var util = require('util'), | ||
return data.map(function(attribute) { | ||
var keyValue = attribute.split('=').map(function(str) { | ||
var keyValue = attribute.split(/=(.+)/).map(function(str) { | ||
return str.trim(); | ||
@@ -107,0 +107,0 @@ }); |
@@ -147,2 +147,24 @@ var fs = require('fs'), | ||
}); | ||
describe('writeVOD', function() { | ||
it('should return a string ending with #EXT-X-ENDLIST', function() { | ||
var m3u1 = getM3u(); | ||
m3u1.set('playlistType', 'VOD'); | ||
m3u1.addPlaylistItem({ duration: 1 }); | ||
var output = m3u1.toString(); | ||
var endStr = '#EXT-X-ENDLIST\n'; | ||
output.indexOf(endStr).should.eql(output.length - endStr.length); | ||
}); | ||
}); | ||
describe('writeLive', function() { | ||
it('should return a string not ending with #EXT-X-ENDLIST', function() { | ||
var m3u1 = getM3u(); | ||
m3u1.addPlaylistItem({}); | ||
var output = m3u1.toString(); | ||
output.indexOf('#EXT-X-ENDLIST\n').should.eql(-1); | ||
}); | ||
}); | ||
}); | ||
@@ -149,0 +171,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41862
1001