Incorrect resolution parsing
Section 4.3.4.2 defines RESOLUTION attribute of EXT-X-STREAM-INF tag as decimal-resolution, that means it must not be parsed as integer. For example for the next playlist
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=140800,RESOLUTION=480x360,CODECS="avc1.64001e,mp4a.40.2"
stream_0.m3u8
current implementation gives
'{
"isExtendedM3U":true,
"segments":
[
{
"isMasterPlaylist":true,
"streamInf":{
"bandwidth":140800,
"resolution":480, // <- should be 480x360
"codecs":["avc1.64001e,mp4a.40.2"]
},
"url":"stream_0.m3u8"
},
],
"version":3
}'
First of all, thanks for your report and PR :)
There are some problems I am having:
when the input is "1080", it would simply output 1080, when the input is "2560x1440" it would output [2560, 1440]; should we consider parse the first one as [1080, undefined] ?
I did it to be backward-compatible, but if it isn't the case, I can refactor to always return tuple of width and height
I think I was wrong at the beginning to parse the value using parseInt, so I think it should be changed.