Socket
Book a DemoInstallSign in
Socket

@chovy/m3u8

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chovy/m3u8

streaming m3u8 parser for Apple's HTTP Live Streaming protocol

1.2.0
latest
Source
npmnpm
Version published
Weekly downloads
1
-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

m3u8

node-m3u8 is a streaming m3u8 parser tailored for dealing with Apple's HTTP Live Streaming protocol. It may work for other m3u files, but I have not tested it for those uses.

Note: this is an updated fork of m3u8 that fixes a bunch of warnings with unknown attributes. These attributes have been accounted for. The main package m3u8 appears to be dead.

install

npm install --save @chovy/m3u8

example

var m3u8 = require('@chovy/m3u8');
var fs   = require('fs');

var parser = m3u8.createStream();
var file   = fs.createReadStream('/path/to/file.m3u8');
file.pipe(parser);

parser.on('item', function(item) {
  // emits PlaylistItem, MediaItem, StreamItem, and IframeStreamItem
});
parser.on('m3u', function(m3u) {
  // fully parsed m3u file
});

All items and the m3u object have toString() methods for conversion to m3u8. Attributes and properties have getter/setters on m3u and item objects:

parser.on('item', function(item) {
  var duration = item.get('bandwidth');
  item.set('uri', 'http://example.com/' + item.get('uri'));
});

The M3U and Item objects are available on m3u8:

var m3u8 = require('@chovy/m3u8');

var m3u = m3u8.M3U.create();
m3u.addPlaylistItem({
  duration : 10,
  uri      : 'file'
});

See tests for more usage patterns.

Keywords

m3u

FAQs

Package last updated on 12 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.