Simple create .m3u8 playlists using array of lines
[
{ "MEDIA": {
"TYPE": "VIDEO",
"GROUP-ID": "chunked",
"NAME": "Source",
"AUTOSELECT": "YES",
"DEFAULT": "YES"
}
},
"http://1.example.com/index.m3u8",
{ "PLAYLIST-TYPE": "VOD" },
{ "EXTINF": "10" }
]
#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
const m3u = require('m3u8-write')
console.log(m3u([
{ "EXTINF": 4 },
"http://1.example.com/index.m3u8"
]))
MIT, 2016 (c) Dmitry Tsvettsikh