Page 1 of 1

multiple players in a single page

Posted: 18 May 2010 16:33
by Antho87
Hello,

I'm French, sorry for possible mistakes... :mrgreen:

my problem is summed up in one question : how to insert multiple activex vlc in the same web page?

I tested by putting a different name to each, but only the first takes over.

Is this possible? how?

Thank's

Re: multiple players in a single page

Posted: 21 May 2010 09:29
by thanaos
Yes you can,

For example :


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8" />
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<title>Layout 4</title>
</head>
<body>
<div align="center">
<table border="0" marginHeight="0" marginWidth="0" cellpadding="0" cellspacing="1">
<tr>
<td width="512" height="384">
<object type="application/x-vlc-plugin" pluginspage="http://www.videolan.org"
version="VideoLAN.VLCPlugin.2" id="vlc1" width="512" height="384" events="True" >
<param name="MRL" value="video.ext" />
<param name="volume" value="50" />
<param name="autoplay" value="false" />
<param name="loop" value="true" />
<param name="fullscreen" value="false" />
</object>
</td>
<td width="512" height="384">
<object type="application/x-vlc-plugin" pluginspage="http://www.videolan.org"
version="VideoLAN.VLCPlugin.2" id="vlc2" width="512" height="384" events="True" >
<param name="MRL" value="video.ext" />
<param name="volume" value="50" />
<param name="autoplay" value="false" />
<param name="loop" value="false" />
<param name="fullscreen" value="false" />
</object>
</td>
</tr>
<tr>
<td width="512" height="384">
<object type="application/x-vlc-plugin" pluginspage="http://www.videolan.org"
version="VideoLAN.VLCPlugin.2" id="vlc3" width="512" height="384" events="True" >
<param name="MRL" value="video.ext" />
<param name="volume" value="50" />
<param name="autoplay" value="false" />
<param name="loop" value="false" />
<param name="fullscreen" value="false" />
</object>
</td>
<td width="512" height="384">
<object type="application/x-vlc-plugin" pluginspage="http://www.videolan.org"
version="VideoLAN.VLCPlugin.2" id="vlc4" width="512" height="384" events="True" >
<param name="MRL" value="video.ext" />
<param name="volume" value="50" />
<param name="autoplay" value="false" />
<param name="loop" value="false" />
<param name="fullscreen" value="false" />
</object>
</td>
</tr>
</table>
</div>
<script type="text/javascript">
var vlc1 = document.getElementById("vlc1");
vlc1.playlist.playItem(vlc1.playlist.add("skippy.avi"));

var vlc2 = document.getElementById("vlc2");
vlc2.playlist.playItem(vlc2.playlist.add("rtsp://192.168.1.12:554/vsip2"));

var vlc3 = document.getElementById("vlc3");
vlc3.playlist.playItem(vlc3.playlist.add("rtsp://192.168.1.12:554/vsip2"));

var vlc4 = document.getElementById("vlc4");
vlc4.playlist.playItem(vlc4.playlist.add("rtsp://192.168.1.12:554/vsip2"));
</script>
</body>
</html>

Re: multiple players in a single page

Posted: 27 May 2010 10:57
by Antho87
Thank you very much thanaos.

The solution works fine with mozilla firefox. But, with Internet Explorer, impossible to insert the activex.

I replaced :
<object type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" version="VideoLAN.VLCPlugin.2" id="vlc1" width="512" height="384" events="True" >

by

<OBJECT classid='clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921' width='512' height='384' id='vlc1' events='True' type="application/x-oleobject">

Internet explorer opens the activex but plays the video in a new window called "VLC (hardware YUV overlay DirectX output)"

how can I do to make the video opens in the same page?

Thanks

Re: multiple players in a single page

Posted: 27 May 2010 15:59
by Ilasir
"x-oleobject"? Why?


This code works fine for me in both IE8 and FF 3.whateverthenewestis. It does not work in Google Chrome.


<html>
<head>
<title>VLC Multiple Players</title>
<script type="text/javascript">
function play()
{
vlc.playlist.playItem(0);
}
function play1()
{
vlc1.playlist.playItem(0);
}
</script>
</head>
<body>
<!--[if IE]>
<object type="application/x-vlc-plugin" pluginspage="http://www.videolan.org"
version="VideoLAN.VLCPlugin.2" id="vlc" width="320px" height="240px"
events="true" classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" >
<param name="mrl" value="video.ext" />
<param name="volume" value="50" />
<param name="autoplay" value="false" />
<param name="loop" value="false" />
<param name="fullscreen" value="false" />
</object>
<![endif]-->
<!--[if !IE]><!-->
<object type="application/x-vlc-plugin" pluginspage="http://www.videolan.org"
version="VideoLAN.VLCPlugin.2" id="vlc" events="true" width="320px" height="240px" >
<param name="mrl" value="video.ext" />
<param name="volume" value="50" />
<param name="autoplay" value="false" />
<param name="loop" value="false" />
<param name="fullscreen" value="false" />
</object>
<!--<![endif]-->
<!--[if IE]>
<object type="application/x-vlc-plugin" pluginspage="http://www.videolan.org"
version="VideoLAN.VLCPlugin.2" id="vlc1" autoplay="true" width="320px" height="240px"
events="True" classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" >
<param name="mrl" value="video.ext" />
<param name="volume" value="50" />
<param name="autoplay" value="false" />
<param name="loop" value="false" />
<param name="fullscreen" value="false" />
</object>
<![endif]-->
<!--[if !IE]><!-->
<object type="application/x-vlc-plugin" pluginspage="http://www.videolan.org"
version="VideoLAN.VLCPlugin.2" id="vlc1" events="True" width="320px" height="240px" >
<param name="mrl" value="video.ext" />
<param name="volume" value="50" />
<param name="autoplay" value="false" />
<param name="loop" value="false" />
<param name="fullscreen" value="false" />
</object>
<!--<![endif]-->
<input type="button" onclick="play()" value="play" />
<input type="button" onclick="play1()" value="play1" />
</body>
</html>

For the record, it works with x-oleobject, too.


ETA: I've tested the code you gave, and it works for me as well.

Re: multiple players in a single page

Posted: 27 May 2010 18:22
by Antho87
Thank you for your help

I inserted the code you gave me, unfortunately I still have the same problem.

I have the latest version of vlc, it is there a configuration problem on my pc that makes this extra window opens?

The player is inserted into the page (black square) but the video is open in another window.

I do not know what to do...

Re: multiple players in a single page

Posted: 27 May 2010 18:33
by Ilasir
What versions of vlc and IE are you running? I'm using IE8 and vlc 1.0.5.

Re: multiple players in a single page

Posted: 27 May 2010 18:43
by Antho87
I'm using IE7 and vlc 1.0.5.

I uninstalled and reinstalled VLC but nothing has changed.

However my code works with mozilla firefox. The problem is that most people use Internet Explorer ...

Re: multiple players in a single page

Posted: 27 May 2010 18:50
by Ilasir
Why haven't you upgraded to IE8?

Re: multiple players in a single page

Posted: 27 May 2010 18:56
by Antho87
The company where I worked we were advised not to use the latest version because of security problems and I use mostly mozilla firefox.

I do the update if the problem is the browser. Only users who come on my site will not necessarily be the latest version ...

Re: multiple players in a single page

Posted: 27 May 2010 19:00
by Ilasir
I don't know if the problem is the browser. I never had trouble with vlc on IE7, but I never tried multiple instances on it, either.

What operating system are you on?

Re: multiple players in a single page

Posted: 27 May 2010 19:29
by Antho87
I use Windows XP.

But hey if only my pc is not working properly is not very serious. Should we just know the remedy to give to the users who encounter the same problem.

Re: multiple players in a single page

Posted: 27 May 2010 19:35
by Ilasir
Hmm... I'm using vista, but that shiuldn't make a big difference... :(

I'm not sure what else I can do for you from my end. The code works for me and for other people. I looked for known bugs, but I didn't find anything.

Re: multiple players in a single page

Posted: 30 Nov 2010 04:25
by Bob26
I have the same problem where I have an <object> embedded in a web page and when using IE8 the video plays in a new window instead of embedded in the web page ... everything works fine in firefox and chrome using <embed> tag. Anyone have a solution to this problem?