Howto reconnect if connection loss with webplayer?
Posted: 28 May 2018 10:40
Hi all,
i'm using the vlc webplayer to show a video from an hd encoder in our digital signage system.
Here is my code:
We're testing a LAN connection lost ad see what happen but also with "--http-reconnect" option the video is not restarting if connection came back on.
Is there a way to make video play again on connection return?
Thanks a lot
i'm using the vlc webplayer to show a video from an hd encoder in our digital signage system.
Here is my code:
Code: Select all
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<object
classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921"
id="vlc"
name="vlc"
class="vlcPlayer"
events="True"
width="1280"
height="720">
<param name="Src" value="rtsp://IPADDRESS:554/rtsp" /> <!-- ie -->
<param name="ShowDisplay" value="True" />
<param name="AutoLoop" value="True" />
<param name="AutoPlay" value="True" />
<!-- win chrome and firefox-->
<embed id="vlcEmb" type="application/x-google-vlc-plugin" version="VideoLAN.VLCPlugin.2" autoplay="yes" loop="yes" width="1280" height="720"
target="rtsp://IPADDRESS:554/rtsp" ></embed>
</object>
<script type="text/javascript" language="javascript">
var vlc = document.getElementById("vlc");
function player(vid) {
try {
var options = new Array("--rtsp-tcp","--http-reconnect");
var id = vlc.playlist.add(vid,'rtsp://IPADDRESS:554/rtsp',options);
vlc.playlist.playItem(id);
vlc.video.fullscreen = true;
//vlc.video.toggleFullscreen();
}
catch (ex) {
alert(ex);
}
}
function mute(){
vlc.audio.toggleMute();
}
function play(){
vlc.playlist.play();
}
function stop(){
vlc.playlist.stop();
}
function pause(){
vlc.playlist.togglePause();
}
function fullscreen(){
vlc.video.toggleFullscreen();
}
</script>
</body>
</html>
Is there a way to make video play again on connection return?
Thanks a lot