1.0.0 • Published 8 years ago

m3u8-write v1.0.0

Weekly downloads
97
License
MIT
Repository
github
Last release
8 years ago

m3u8-write

travis npm license downloads

Simple create .m3u8 playlists using array of lines

Example

input

[
  { "MEDIA": { 
      "TYPE": "VIDEO",
      "GROUP-ID": "chunked",
      "NAME": "Source",
      "AUTOSELECT": "YES",
      "DEFAULT": "YES" 
    }
  },
  "http://1.example.com/index.m3u8",
  { "PLAYLIST-TYPE": "VOD" },
  { "EXTINF": "10" }
]

output

#EXTM3U
#EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="chunked",NAME="Source",AUTOSELECT=YES,DEFAULT=YES
http://1.example.com/index.m3u8
#EXT-X-PLAYLIST-TYPE:VOD
#EXTINF:10

Usage

const m3u = require('m3u8-write')

console.log(m3u([
  { "EXTINF": 4 },
  "http://1.example.com/index.m3u8"
]))

License

MIT, 2016 (c) Dmitry Tsvettsikh