
Problem to add multiple sources
Hello,
I am trying to add multiple sources to my website,
Basically, I want JW player will load 1st link first (link1), if 1st link's broken then load second link (link2).
Here is my example :
http://canthotv.vn/huy/jwplayer/?l=http://media.canthotv.vn/2015/TH/07/20/PS_themanhvocotruyen.mp4&i=http://canthotv.vn/wp-content/uploads/2015/07/vocotruyen.jpeg&w=390&h=300&a=1&l2=http://media.canthotv.vn/2015/TH/07/20/Bantincuoingay_19072015.mp4
My problem is JW Player doesn't work as I thought, when I changed .mp4 (link1) to .mp4abcdef, it's working, however when I change link1 path, it doesn't working.
Here is the code in index.php
<?php
$allowurl=$_SERVER['HTTP_HOST'];
//if(!strstr($_SERVER['HTTP_REFERER'],$allowurl)) exit("");
$l=$_GET['l'];
$l2=$_GET['l2'];
$w=$_GET['w'];
$h=$_GET['h'];
$i=$_GET['i'];
$a=$_GET['a'];
if($a==1) $a="true"; else $a=false;
?>
<!DOCTYPE html>
<html>
<style type="text/css">
*{padding:0; margin:0;}
</style>
<body>
<div id="mediaplayer">Loading...</div>
<script type="text/javascript" src="jwplayer.js"></script>
--License Key--
<script type="text/javascript">
jwplayer("mediaplayer").setup({
sources: [
{file: "<?php echo $l; ?>"}
<?php if($l2!="") echo ",{file: \"".$l2."\"}"; ?>
],
image: "<?php echo $i; ?>",
sharing: {},
skin: "/jwplayerskins/five.xml",
autostart: "true",
screencolor: "ffffff",
width: "<?php echo $w; ?>",
height: "<?php echo $h; ?>",
stretching: "uniform",
});
</script>
</body>
</html>
thank you