vlc 0.8.6 ActiveX problem with IE

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
ParKiN
New Cone
New Cone
Posts: 6
Joined: 23 Nov 2006 14:41

vlc 0.8.6 ActiveX problem with IE

Postby ParKiN » 18 Jan 2007 15:52

Hi everybody, thanks all the developpers for the great work made for VLC, this is really a wonderful software!

Now my problem: I'm trying to play some videos (url : mms:\\azerty.wmv for example) on a website.
the code looks like this in the body tag:

Code: Select all

<object id="vlcAx" class="vlcAx"height="260" width="320" classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921"> <param name="AutoPlay" value="True" /> <param name="AutoStart" value="True" /> <object id="vlc" class="vlc" height="260" width="320" type="application/x-vlc-plugin"> <param name="AutoStart" value="True" /> <param name="AutoPlay" value="True" /> </object> </object>
In the head tag, i have :

Code: Select all

sPathVideo = "mms://sIdVideo + "_250kb.wmv"; if(navigator.userAgent.toLowerCase().indexOf("msie") != -1) { vlc.style.visibility = "hidden"; document.getElementById("vlcAx").add_item(sPathVideo); document.getElementById("vlcAx").set_volume(100); document.getElementById("vlcAx").play(); } else if(navigator.userAgent.toLowerCase().indexOf("gecko") != -1) { document.getElementById("vlc").add_item(sPathVideo); document.getElementById("vlc").set_volume(100); document.getElementById("vlc").play(); }
It works perfectly with Firefox 2.0.0.1 but I try with IE 6, and I only have the cone image, the video doesn't start.
Can someone help me with that? thanks.

divx118
Blank Cone
Blank Cone
Posts: 95
Joined: 22 Jun 2006 18:19

Postby divx118 » 18 Jan 2007 17:37

You could try to add the javascript in a function and call it with an onload in the body tag.

Maurice

ParKiN
New Cone
New Cone
Posts: 6
Joined: 23 Nov 2006 14:41

Postby ParKiN » 18 Jan 2007 18:16

Maurice, I tried your solution but there is no change.

IE could not execute this code :

Code: Select all

document.getElementById("vlcAx").add_item(sPathVideo);

And I have the following error in IE :

cet objet ne gère pas cette propriété ou cette méthode

I tried with :

Code: Select all

document.getElementById("vlcAx").playlist.add(sPathVideo); document.getElementById("vlcAx").playlist.play();
but I obtain another error in IE :

'document.getElementById(...).playlist' a la valeur Null ou n'est pas un objet

What can I do to play this video?
thanks.

ParKiN

divx118
Blank Cone
Blank Cone
Posts: 95
Joined: 22 Jun 2006 18:19

Postby divx118 » 18 Jan 2007 18:33

Could you please post your complete code?
There are some things i noticed
sPathVideo = "mms://sIdVideo + "_250kb.wmv";

sIdVideo is that a variable if so it should be sPathVideo = "mms://" + sIdVideo + "_250kb.wmv";
And you set the <param name="AutoPlay" value="false" /> because you haven't add a video to the playlist yet.
<param name="AutoStart" value="True" /> I didn't know this parameter exist.

Maurice

ParKiN
New Cone
New Cone
Posts: 6
Joined: 23 Nov 2006 14:41

Postby ParKiN » 19 Jan 2007 10:17

You're right, I made a little mistake ! sorry.

Here is my complete html page :

Code: Select all

<head> <title>Visionneuse</title> <script type = "text/javascript" language = "JavaScript"> var sPathVideo; function bootinit() { bFromSearch = getQueryStringByName("fs"); var sIdVideo = getQueryStringByName("id"); var cstep = getQueryStringByName("cstep"); if(cstep==2) sPathVideo = "mms://"+ sIdVideo + "_100kb.wmv"; else if(cstep==3) sPathVideo = "mms://"+ sIdVideo + "_250kb.wmv"; document.getElementById("titre_video").value = getQueryStringByName("titre"); if(navigator.userAgent.toLowerCase().indexOf("msie") != -1) { vlc.style.visibility = "hidden"; //does nothing !!! document.getElementById("vlcAx").add_item(sPathVideo); document.getElementById("vlcAx").set_volume(100); document.getElementById("vlcAx").play(); } else if(navigator.userAgent.toLowerCase().indexOf("gecko") != -1) { document.getElementById("vlc").add_item(sPathVideo); document.getElementById("vlc").set_volume(100); document.getElementById("vlc").play(); } } function Retour() { if (bFromSearch == "1" ) self.location.href = "../recherche.asp?reaffiche=1"; else self.location.href = "../contenu_1.htm"; } function Play() { if(navigator.userAgent.toLowerCase().indexOf("gecko") != -1) { if(document.getElementById("vlc").Playing) document.getElementById("vlc").pause(); else document.getElementById("vlc").play(); } else if(navigator.userAgent.toLowerCase().indexOf("msie") != -1) { if(document.getElementById("vlcAx").Playing) document.getElementById("vlcAx").pause(); else document.vlcAx.playlist.play(); } } function Stop() { if(navigator.userAgent.toLowerCase().indexOf("gecko") != -1) document.getElementById("vlc").stop(); else if(navigator.userAgent.toLowerCase().indexOf("msie") != -1) alert("pas encore supporté !"); } function Fullscreen() { if(navigator.userAgent.toLowerCase().indexOf("gecko") != -1) document.getElementById("vlc").fullscreen(); else if(navigator.userAgent.toLowerCase().indexOf("msie") != -1) alert("pas encore supporté !"); } function incrVolume() { if(navigator.userAgent.toLowerCase().indexOf("gecko") != -1) { if(document.getElementById("vlc").get_volume() <200) document.getElementById("vlc").set_volume(document.getElementById("vlc").get_volume()+20); } else if(navigator.userAgent.toLowerCase().indexOf("msie") != -1) alert("pas encore supporté !"); } function decrVolume() { if(navigator.userAgent.toLowerCase().indexOf("gecko") != -1) { if(document.getElementById("vlc").get_volume() > 0) document.getElementById("vlc").set_volume(document.getElementById("vlc").get_volume()-20); } else if(navigator.userAgent.toLowerCase().indexOf("msie") != -1) alert("pas encore supporté !"); } </script> </head> <body onload = "bootinit()"> <div > <input class = "titre_video" id = "titre_video" name = "text1" readonly = "readonly" /> </div> <div > <object id="vlcAx" class="vlcAx" height="260" width="320" classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921"> <param id = "AutoPlay" name="AutoPlay" value="True" /> <param id = "AutoStart" name="AutoStart" value="True" /> <object id="vlc" class="vlc" height="260" width="320" type="application/x-vlc-plugin"> <param name="AutoStart" value="True" /> <param name="AutoPlay" value="True" /> </object> </object> </div> <div> <a onclick="Retour()" href="#">Retour</a> <a onclick="Play()" href="#">Lecture</a> <a onclick="Stop()" href="#">Stop</a> <a onclick="Fullscreen()" href="#">Plein écran</a> Volume : <a onclick="incrVolume()" href="#">(+)</a> <a onclick="decrVolume()" href="#">(-)</a> </div> </body>
Thank you for your interest.

ParKiN

divx118
Blank Cone
Blank Cone
Posts: 95
Joined: 22 Jun 2006 18:19

Postby divx118 » 19 Jan 2007 18:03

You are not using the right methods for the 0.8.6 plugin see the documentation here scroll down until you reach Build HTML pages that use the plugin (version > 0.8.5.1) .
You also should look at the source of this testsite

Hope this will help you.

Maurice

wser
Blank Cone
Blank Cone
Posts: 32
Joined: 23 Jan 2007 17:35
Location: Bern, Switzerland
Contact:

Postby wser » 25 Jan 2007 00:56

hi

I use for IE the defined plugin url from videolan such as:

"http://downloads.videolan.org/pub/video ... /axvlc.cab"

for other browser such as mozilla see one post above.

Do you know the problem, that any user, which haven`t installled VLC yet on his client, is beeing stopped by the IE Browser Security Settings?
To solve it you have to change the Security Level to: download unsigned activeX elements (activate-not save/confirmation). This is likely difficult for users who don`t know this, and there are a lot of them, including me.

So, keep on listening

Cheers

WSER

ParKiN
New Cone
New Cone
Posts: 6
Joined: 23 Nov 2006 14:41

Postby ParKiN » 25 Jan 2007 13:01

Thanks to all of you for your interest about my problem !
WSER, I already know what you're talking about, I added a little link to a webpage which explain how to change those settings in IE. I hope that customers will succeed with this!
ParKiN


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 48 guests