Tenho uma programação de streaming de video do youtube..
que funciona porem quero variar no meu otserv..
Quero que funcione esse link..
ao invez de youtube quero adicionar essa programação exemplo abaixo.
http://185.181.100.218:8081/live/ae_1/playlist.m3u8?nimblesessionid=245338&wmsAuthSign=c2VydmVyX3RpbWU9NC8xMC8yMDE3IDQ6NDc6NDMgUE0maGFzaF92YWx1ZT1NMUZ6TkJSWlFaMmVrdC9hcWQzUUF3PT0mdmFsaWRtaW51dGVzPTEw
Por favor me ajudem pessoal.. desde ja agradeço.
Essa e a programação que uso para videos no youtube
exemplo de como eu uso..
Canal.. do youtube
Canal do youtube exemplo.
https://www.youtube.com/watch?v=y60wDzZt8yg
codigo.
http://127.0.0.1/youtube.php?watch?v=y60wDzZt8yg
http://127.0.0.1/youtube.php? + watch?v=y60wDzZt8yg
Codigo usado.
<?PHP
$channelid = $_GET["watch?v"];
ini_set("user_agent","facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)");
/* gets the data from a URL */
function get_data($url) {
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_USERAGENT, "facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)");
curl_setopt($ch, CURLOPT_REFERER, "http://facebook.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
$string = get_data('http://185.181.100.218:8081/live/ae_1/playlist.m3u8?' . $channelid);
preg_match_all('/(hlsvp.*m3u8)/',$string,$matches, PREG_PATTERN_ORDER);
$var1=$matches[1][0];
$var1 = substr($var1, 8);
$var1=str_replace("\/", "/", $var1);
#Quality Settings
/* 96=1920x1080, 95=1280x720, 94=854x480, 93=640x360 */
$man = get_data($var1);
preg_match_all('/(https:\/.*\/95\/.*)/U',$man,$matches, PREG_PATTERN_ORDER);
$var2=$matches[1][0];
header("Content-type: application/vnd.apple.mpegurl");
header("Location: $var2");
?>