multiple players in a single page

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
Antho87
New Cone
New Cone
Posts: 7
Joined: 14 Sep 2009 17:32

multiple players in a single page

Postby Antho87 » 18 May 2010 16:33

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

thanaos
Blank Cone
Blank Cone
Posts: 10
Joined: 10 May 2010 09:27

Re: multiple players in a single page

Postby thanaos » 21 May 2010 09:29

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>

Antho87
New Cone
New Cone
Posts: 7
Joined: 14 Sep 2009 17:32

Re: multiple players in a single page

Postby Antho87 » 27 May 2010 10:57

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

Ilasir
Cone that earned his stripes
Cone that earned his stripes
Posts: 139
Joined: 14 Apr 2010 18:57

Re: multiple players in a single page

Postby Ilasir » 27 May 2010 15:59

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

Antho87
New Cone
New Cone
Posts: 7
Joined: 14 Sep 2009 17:32

Re: multiple players in a single page

Postby Antho87 » 27 May 2010 18:22

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

Ilasir
Cone that earned his stripes
Cone that earned his stripes
Posts: 139
Joined: 14 Apr 2010 18:57

Re: multiple players in a single page

Postby Ilasir » 27 May 2010 18:33

What versions of vlc and IE are you running? I'm using IE8 and vlc 1.0.5.

Antho87
New Cone
New Cone
Posts: 7
Joined: 14 Sep 2009 17:32

Re: multiple players in a single page

Postby Antho87 » 27 May 2010 18:43

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

Ilasir
Cone that earned his stripes
Cone that earned his stripes
Posts: 139
Joined: 14 Apr 2010 18:57

Re: multiple players in a single page

Postby Ilasir » 27 May 2010 18:50

Why haven't you upgraded to IE8?

Antho87
New Cone
New Cone
Posts: 7
Joined: 14 Sep 2009 17:32

Re: multiple players in a single page

Postby Antho87 » 27 May 2010 18:56

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

Ilasir
Cone that earned his stripes
Cone that earned his stripes
Posts: 139
Joined: 14 Apr 2010 18:57

Re: multiple players in a single page

Postby Ilasir » 27 May 2010 19:00

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?

Antho87
New Cone
New Cone
Posts: 7
Joined: 14 Sep 2009 17:32

Re: multiple players in a single page

Postby Antho87 » 27 May 2010 19:29

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.

Ilasir
Cone that earned his stripes
Cone that earned his stripes
Posts: 139
Joined: 14 Apr 2010 18:57

Re: multiple players in a single page

Postby Ilasir » 27 May 2010 19:35

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.

Bob26
New Cone
New Cone
Posts: 1
Joined: 30 Nov 2010 04:00

Re: multiple players in a single page

Postby Bob26 » 30 Nov 2010 04:25

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?


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 5 guests