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

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -