@krad/slugline

A library for parsing HLS playlists

Stats

StarsIssuesVersionUpdatedCreatedSize
@krad/slugline
1.2.243 years ago3 years agoMinified + gzip package size for @krad/slugline in KB

Readme

slugline

Build Status Coverage Status

slugline is a library for consuming HLS playlists.

It can be used in node.js and in the browser.

Features

  • ✅ Fetching playlists
  • ✅ Fetching media segments
  • ✅ Parsing Media Playlists
  • ✅ Parsing Master Playlists
  • ✅ Retry logic (timeout, 500, network error, etc)
  • ✅ Parsing Media Segments
    • ✅ Fragmented MP4
    • ✅ Transport Stream
      • ✅ PAT
      • ✅ PMT
      • ✅ Packetized Elementary Streams
      • ✅ ADTS Streams
  • ✅ Transmuxing transport streams to fragmented mp4
  • ✅ Periodic fetching of event & live playlists
  • ❎ Range Requests

Usage

COMING SOON

Demos

COMING SOON

Development setup

Dependencies for setting up a development environment are managed with npm. One needs to simply clone the repo and run npm install like so:

$ git clone https://github.com/krad/slugline.git slugline
$ cd slugline
$ npm install

Testing

Preparation

The test suite relies on some fixtures that are too large to be distributed along with the library. A fetch script is included and relies on wget to retrieve assets.

To prepare the environment simply run:

$ ./tests/fixtures/fetch.sh

And wait for all the assets to download.

Running tests

Unit tests

npm run test

Autotesting

npm run autotest

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.