Howto reconnect if connection loss with webplayer?

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
andre85
New Cone
New Cone
Posts: 5
Joined: 25 May 2018 18:14

Howto reconnect if connection loss with webplayer?

Postby andre85 » 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:

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>
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

da2424
Cone that earned his stripes
Cone that earned his stripes
Posts: 310
Joined: 16 Apr 2013 16:57

Re: Howto reconnect if connection loss with webplayer?

Postby da2424 » 29 May 2018 23:01

You could use the method setTimeout, see https://forum.videolan.org/viewtopic.ph ... 33#p473292


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 7 guests