Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

m3u8

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

m3u8 - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

6

m3u.js

@@ -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' },

3

m3u/Item.js

@@ -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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc