javascript - Redirect to url, If Jwplayer error loading media -
i embedded jwplayer on page sometime video cant loaded, can me how make redirect new url if jwplayer cant load file
this code:
<script type='text/javascript'> jwplayer('player').setup({ file: 'http://blog.com/stream.m3u8', image: 'http://blog.com/streamimage.png', title: 'streaming title', width: '100%', height: "100%", aspectratio: '16:9', skin: 'glow', mute: 'true', ga: '{}' }); </script>
this code change source video, need make redirect new url use header location
jwplayer().onerror(function(){ jwplayer().load({file:"http://jwplayer.com/errorfile.mp4", image:"http://blog.com/streamimage-error.png"}); // });
like this:
<?php header("location: http://www.example.com/"); ?> /* redirect browser */
please me
to redirect using javascript, use :
window.location.href = 'http://wherever';
Comments
Post a Comment