Skip to content

reklatsmasters/m3u8-write

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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