m3u8-reader
v1.1.0
Published
Read and parse m3u8 playlist into array
Downloads
556
Readme
m3u8-reader
Read and parse m3u8 playlist into array
Example
input
#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,
output
[
{ "MEDIA": {
"TYPE": "VIDEO",
"GROUP-ID": "chunked",
"NAME": "Source",
"AUTOSELECT": "YES",
"DEFAULT": "YES"
}
},
"http://1.example.com/index.m3u8",
{ "PLAYLIST-TYPE": "VOD" },
{ "EXTINF": "10" }
]
Usage
const m3u = require('m3u8-reader')
const fs = require('fs')
console.log(m3u(fs.readFileSync('test.m3u8', 'utf8')))
Related
- m3u8-write - create .m3u8 playlist from an array of objects
- m3u8-stream-list - read list of streams from .m3u8 playlist
License
MIT, 2016 (c) Dmitry Tsvettsikh