Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

auto recconect when you lost internet connection


i am trying to enable auto reconnect when someone loss internect conection the player would be auto reconnect automatically after they reestablish internet connection.
i am using this embed code:

<!DOCTYPE html>
<html>
<head>
<script src="http://jwpsrv.com/library/pgTaLK3jEeOqIiIACmOLpg.js"></script>
</head>
<body>

<div id='playerQkbZizdfJlia'></div>
<script type='text/javascript'>
jwplayer('playerQkbZizdfJlia').setup({
file: 'rtmp://208.100.14.24/vod/mp4:sample.mp4',
image: 'http://www.longtailvideo.com/content/images/jw-player/lWMJeVvV-876.jpg',
title: 'test',
width: '640',
height: '360',
autostart: 'true',
primary: 'flash'
});
jwplayer().onError(function(){
jwplayer().load({file:"http://content.jwplatform.com/videos/7RtXk3vl-52qL9xLP.mp4",image:"http://content.jwplatform.com/thumbs/7RtXk3vl-480.jpg"});
jwplayer().play();
});
jwplayer().onComplete(function(){
window.location = window.location.href;
});
jwplayer().onBuffer(function(){
theTimeout = setTimeout(function(){
jwplayer().load({file:"http://content.jwplatform.com/videos/7RtXk3vl-52qL9xLP.mp4",image:"http://content.jwplatform.com/thumbs/7RtXk3vl-480.jpg"});
jwplayer().play();
},5000);
});
jwplayer().onPlay(function(){
clearTimeout(theTimeout);
});
</script>
</body>
</html>
----------------------------------------------------
here is a video sample for other website that use auto reconnect, i would like to use something similar to enable in my jwplayer. also i upload a sample video using the jwplayer embed code to auto reconnect, but it looks that is not working properly. you can see in the video.
http://208.100.14.24/sampletest/livestream.wmv
208.100.14.24/sampletest/jwplayer.wmv
also it would be great if you enable this autoreconnect option in jwplayer -->control panel , publish-> your website

2 Community Answers

Ethan Feldman

JW Player Support Agent  
-1 rated :

If you have lost your connection, then you will not be able to do a load() event, since you won’t have any connectivity. A better way to go about this would be to just simply do something like this:

jwplayer().onBuffer(function(){
theTimeout = setTimeout(function(){
window.location = window.location.href;
},5000);
});

So it will just reload the page after 5 seconds after the connection drops. Then you can make the player autostart so it will try to play again.

zhoulin

User  
0 rated :

That is not feasible.I would also like to how to solve this problem.When the network is disconnected,the js cannot receive a events.Maybe I did not find this events.
if huo solve this question.plealse tell me.My email is zhoulin@xishui.in.thanks.

This question has received the maximum number of answers.