[vlc] VLC on Web page problem

Anthony Loiseau thannoy at actech-innovation.com
Fri Nov 13 10:05:09 CET 2009


Hi,

On Thu, 2009-11-12 at 12:42 +0000, Kaliszan, Mariusz (GE EntSol,
Security) wrote:
> Hello!
> 
> We are trying to use VLC plugin on our web page to display RTSP
> stream. We embeded plugin in such way: 
> <OBJECT classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" 
> 
> codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/ax 
>         <?php printScales()?> 
>         id="vlc" 
>         events="True"> 
>         <param name="MRL" value="" /> 
I would have removed the upper line since there is no MRL to give

>         <param name="ShowDisplay" value="True" /> 
>         <param name="AutoLoop" value="False" /> 
>         <param name="AutoPlay" value="True" /> 
The same for AutoPlay and maybe the same for StartTime since it is zero
and I am not sure non-zero values works.

>         <param name="StartTime" value="0" /> 
>         <EMBED pluginspage="http://www.videolan.org" 
>                 type="application/x-vlc-plugin" 
>                 progid="VideoLAN.VLCPlugin.2" 
>                 <?php printScales()?> 
>                 name="vlc"> 
>         </EMBED> 
> </OBJECT>
> 
> <SCRIPT type="text/javascript">startPlay();</SCRIPT>
> 
> And javascript function "startPlay()" looks like that: 
> function startPlay() { 
>         var vlc = document.getElementById("vlc"); 
>         var options = new Array(":aspect-ratio=4:3"); 
You can replace it by:  new Array(":no-video") since you have no video

>         var itemName = document.getElementById('mrldropdown').value; 
>         var itemId = vlc.playlist.add(itemName, null, options); 
>         if( itemId != -1 ) { 
>                 vlc.playlist.playItem(itemId); 
>         } 
> }
> 
> 1) The first question (not so important and not the main reason of
> this email) is why VLC starts playing even if there is no
> vlc.playlist.playItem(itemId) in the code?
Maybe the AutoPlay parameter.

> 
> However the real problem we have when we open page that tries to play
> RTSP stream from device where there is no video source - camera cable
> is unplugged from device that generates RTSP stream so device is
> available under specified address, but video does not exist. When the
> page is opened it's ok until we try to do anything eg. click button or
> click link. Then web browse hangs up (Internet Explorer, Mozilla
> Firefox) - becomes not responding and we need to kill web browser
> process or... connect video source - then web browser becomes
> operational again.
Ensure this JS function is not called in a loop when you click the
webpage.. I have no  other idea.

Emm yes: try different releases of VLC too.

> 
> It seems that vlc.playlist.add method is the reason of this behaviour
> - only when it is called in the code we have such situation.
> 
> 2) Can you explain how vlc.playlist.add works internally or point what
> we can do to avoid such situation with web browser not responding?
For what I have seen using it, some calls are or seems to be
asynchronous (due to threads messaging I guess) and having two playlist
JS calls in a row may cause problem when executing the second.

On my side, I had tweaked small delays between some calls if I remember
correctly. If you think it cause you bugs, you can easily insert a
alert() call before your playItem() call.


Regards.
Anthony

> 
> 
> Best regards
> 
> Mariusz Kaliszan 
> Software Engineer 
> GE 
> Security
> 
> T +48 58 326 22 47 
> F +48 58 305 35 63 
> E mariusz.kaliszan at ge.com
> 
> Sadowa 8 
> 80-771 Gdańsk, Polska 
> GE Security Polska sp. z o.o.
> 
> GE imagination at work
> 
> 
> ______________________________________________________
> vlc mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc




More information about the vlc mailing list