Scripting mozilla plugin

Microsoft Windows specific usage questions
Forum rules
Please post only Windows specific questions in this forum category. If you don't know where to post, please read the different forums' rules. Thanks.
Schendstok
New Cone
New Cone
Posts: 6
Joined: 03 Jan 2006 22:22

Scripting mozilla plugin

Postby Schendstok » 03 Jan 2006 22:30

Hi,

I've got a problem scripting the mozilla plugin with Javascript.
I try to start my TV card using javascript with this code:

Code: Select all

function startKan() { document.video1.add_item('dshow:// :dshow-vdev="Hauppauge WinTV PVR PCI II Capture"'); document.video1.play(); }
but this doesn't work, it starts the first directshow device that is my webcam, so it does the same thing as if I would use:

Code: Select all

function startKan() { document.video1.add_item('dshow:// '); document.video1.play(); }

I thought it was a problem with escape charecters or something , but it doesn't seem to be. (tried a lot of things)
I also saw a post about using an "options" array because the vlc plug-in wouldn't parse the string or something (in IE by the way). But that also gives the same result.

Could somebody give me a working example code to start the TV card?
many thanks

BTW. I use 0.8.4a for windows 32 on WinXP of VLC
Last edited by Schendstok on 04 Jan 2006 02:18, edited 1 time in total.

Schendstok
New Cone
New Cone
Posts: 6
Joined: 03 Jan 2006 22:22

Postby Schendstok » 04 Jan 2006 02:15

I did some more testing, and I now have some code that works in internet explorer with the ActiveX plug-in:

Code: Select all

<html> <head> </head> <input type=button id="start" value=" Play " onClick='StartTV()'> <object classid="clsid:E23FE9C6-778E-49D4-B537-38FCDE4887D8" codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab" width="400" height="300" id="vlc" events="True"> <param name="Src" value="" /> <param name="ShowDisplay" value="True" /> <param name="Loop" value="False" /> <param name="AutoPlay" value="False" /> </object> <script> function StartTV() { var options = new Array(":dshow-vdev=Hauppauge WinTV PVR PCI II Capture"); document.vlc.addTarget("dshow://", options, 4+8, -666); }; </script> </body> </html>
The problem is that the ActiveX plug in isn't mentioned in the documentation on the website. Does anybody have a link to a little bit of documentation?
I would really like to know why I need to add the ", 4+8, -666" in the addTarget tag. I doesn't work without is, But I don't have a clue about what it does.


But back to my Problem: this doesn't work in firefox!
The equivalent in the code for the mozilla plug-in:

Code: Select all

<html> <head> </head> <input type=button id="start" value=" Play " onClick='StartTV()'> <embed type="application/x-vlc-plugin" name="vlc" autoplay="no" loop="no" width="400" height="300" /> </object> <script> <!-- function StartTV() { var options = new Array(":dshow-vdev=Hauppauge WinTV PVR PCI II Capture"); document.vlc.add_item("dshow://", options, 4+8, -666); document.vlc.play(); }; //--> </script> </body> </html>
But this does not work! the "add_item" method doesn't do anything with the added options array, so it just starts the first directshow device (a webcam in on my configuration)

does anybody have a solution?

Schendstok
New Cone
New Cone
Posts: 6
Joined: 03 Jan 2006 22:22

Postby Schendstok » 04 Jan 2006 03:39

Another question I have about the ActiveX plug-in functions.

Can the video screen be resized using javascript?
If the videoscreen has an ID named "vlc"
You could change the attributes like this:

document.vlc.height = "480";
document.vlc.width = "640";

But this doesn't resize the screen when using the ActiveX plug-in. Are there other resize functions in this plug-in?

The above code does work perfectly with the Mozilla plug-in.

Also in both the Mozilla plug-in and the ActiveX plugin
document.vlc.fullscreen();
Works perfectly to fill the screen in both implementations.

I also noticed that the Mozilla plug-in can crash firefox of you open the plug-in multiple times. Is this a known bug?

boban

Postby boban » 25 May 2006 15:59

for resize use:
document.vlc.style.height="100"

ajithjames
New Cone
New Cone
Posts: 1
Joined: 25 Jul 2006 07:14
Contact:

re

Postby ajithjames » 03 Apr 2007 13:44

use it as
add_item('string');
then it works well


Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: Google [Bot] and 50 guests