Hi There -
Munich's PHP script works great to get a redirect on an IOS device and the video play right away with no issues.
Now that JW Player has come out with their JW Player 6 which supports HLS streaming, I'm trying to figure out how to create a simple embed for HLS only which will play in flash browsers or on IOS. I can get it to work great if I hard code the http url to an edge server like follows. If I create a PHP script like munichs above and reference it via a URL, I'm getting an error "Manifest is not a valid M3U8 File". Does anyone have a suggestion on how one might modify or build a php file to create or build a vaild M3U8 URL after the PHP script gets the least loaded edge server via the http redirect. The PHP File is below:
Thank you in advance for any pointers or suggestions.
Tim
Embed CODE:
Code:
<head>
<script type='text/javascript' src='/jwplayer6/jwplayer.js'></script>
<script type="text/javascript">jwplayer.key="key.... ";</script>
</head>
<body>
<div id="livestream"></div>
<script type="text/javascript">
jwplayer("livestream").setup({
file: "http://edgeserver.domain.com/livestreams/smil:streamname.smil/playlist.m3u8",
type: "hls",
height: 576,
width: 1024,
autostart: true,
});
</script>
</body>
PHP File:
Code:
<?php
// CONFIG START - Input in your Wowza Dynamic Loadbalancers address, your application's name and the streamname
$lburl = "http://load.domain.com:1935/loadbalancer";
$appname = "livestreams";
$streamname = "smil:streamname.smil";
// Config END
$content = file_get_contents ($lburl);
$replacewith = "";
$ip = str_replace('redirect=', $replacewith, $content);
header("Cache-Control: no-cache, must-revalidate");
header("Location:http://$ip/$appname/$streamname/playlist.m3u8");
?>