Monday, 12 August 2013

How to parse diffrent resolution m3u8 urls from m3u8 variable?

How to parse diffrent resolution m3u8 urls from m3u8 variable?

I got the following m3u8 as php variable. Now i want to replace
proxy-63.somesite.com part of all m3u8 with video2.de.secondsite.net then
create a hyperlink for each resolution and place all the hyperlinks in
textarea.(for each resolution hyperlink i want to place the resolution of
m3u8 in bracket after hyperlink title).
could any one tell me how i can achieve this task? Thanks in advance
#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=836280,CODECS="mp4a.40.2,avc1.64001f",RESOLUTION=768x432
http://proxy-63.somesite.com/sec(42341234k32jlkjk234lkwerwlk32432)/video/600/500/12345678_mp4_h264_aac_hq_2.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=246440,CODECS=
"mp4a.40.2,avc1.42000d",RESOLUTION=320x180
http://proxy-63.somesite.com/sec(45432kjkhjkj4535lkj34543454lkj43)/video/600/500/12345678_mp4_h264_aac_ld_2.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=460560,CODECS=
"mp4a.40.2,avc1.42001e",RESOLUTION=512x288
http://proxy-63.somesite.com/sec(dfgghdfdgd987435392429324343241k)/video/600/500/12345678_mp4_h264_aac_2.m3u8
PHP
$link_text .="<a
href=\"../Player.php?&vidID=".$m3u8Url."&title=".$title_name."\">".$title_name."."(".".$resolution.".")"</a><br/>\n";

No comments:

Post a Comment