Page 1 of 1

Problem controlling embedded VLC in FF 1.5

Posted: 15 Feb 2006 13:07
by Mikeman
Hi there,
I have a problem with VLC 0.8.4a in FF 1.5.x on WinXP/2k:

Here is a code sample:

Code: Select all

<embed type="application/x-vlc-plugin" src="./foo.mpg" id="VLCPlayer" autoplay="true" loop="yes" /> <a href="javascript:document.VLCPlayer.pause()">PAUSE</a>
The video will start but cannot be paused via the link.
FF throws the follwing JS error in the JS console:
document.VLCPlayer.pause is not a function

The same code works without a problem in FF 1.0.7.

Is there a change in handling <embed> objects in FF 1.5 or is it a bug in VLC

Thanks a lot
Mikeman

Posted: 15 Feb 2006 13:19
by dionoea
does document.getElementById("VLCPlayer").pause() work ?

Posted: 15 Feb 2006 13:38
by Mikeman
no.
the JS error now is (of course):
document.getElementById("VLCPlayer").pause is not a function

I have also already tried to put the pause command into a JS function.

Does it work in your FF 1.5?

Posted: 15 Feb 2006 14:09
by Mikeman
Just to add some more information on this topic:

I have another machine here (XPpro SP2) with both FF 1.07 and FF 1.5.01 installed.
The script works in FF 1.0.7 and does not in FF 1.5.0.1.

The script also works in Moz 1.7.12 and Netscape 8.

Well, seems to be a FF 1.5.x related issue.

Mikeman

Posted: 15 Feb 2006 19:46
by Guest
try using name instead of id

I'm using:

<script ... >
function pl_play(){
document.stream1.play();
}
function pl_pause(){
document.stream1.pause();
}
function pl_stop(){
document.stream1.stop();
}
<snip>
</script>
...
<body>
<embed type="application/x-vlc-plugin"
name="stream1"
autoplay="no" loop="no" hidden="yes"
target="http://www.di.fm/mp3/trance.pls" />

</body>

Posted: 16 Feb 2006 10:09
by Mikeman
again, using <name> works in my FF 1.0.7 but not in my FF 1.5.0.1.
Do you have FF 1.5.x?

I think it is not a problem of identifiying the VLC object.

The object seems not to accept the command "pause()" in FF 1.5 or FF does not pass through the command.

Mikeman

Posted: 16 Feb 2006 16:57
by tonsofpcs
use both name and ID.

Posted: 20 Feb 2006 12:36
by Mikeman
well - no.
Here is the current code that still does not work in FF 1.5:

Code: Select all

<html> <body> <embed type="application/x-vlc-plugin" src="./foo.mp4" name="VLCPlayer" id="VLCPlayer" autoplay="true" loop="yes" hidden="no" showdisplay="yes" /><br /> <a href="javascript:document.VLCPlayer.pause()">PAUSE 1</a><br /> <a href="javascript:document.getElementById('VLCPlayer').pause()">PAUSE 2</a> </body>
I tried it also with the object tag:

Code: Select all

<html> <body> <object type="application/x-vlc-plugin" name="VLCPlayer" id="VLCPlayer" data="./foo.mp4" width="400" height="300"> </object> <br /> <a href="javascript:document.VLCPlayer.pause()">PAUSE</a><br /> <a href="javascript:document.getElementById('VLCPlayer').pause()">PAUSE</a> </body>
No change - the video cannot be paused with one of the links.
Still my question is: Does this code work in anyone's FF 1.5??

Thanks
Mikeman

Posted: 20 Feb 2006 19:40
by tonsofpcs
Haven't tried, just looking and guessing on the way out the door, but what about inserting ; after the commands?

Posted: 21 Feb 2006 09:24
by Mikeman
well, as I mentioned in an earlier post, I also have tried to put the pause() command into a JS function.
I don't think we have a DOM or JS syntax problem here.
FF 1.5 simply doesn't recognize the pause() command or VLC doesn't accept it anymore in FF 1.5.

Mikeman

Posted: 01 Mar 2006 01:21
by ken
works fine for me:

Firefox 1.5.0.1
VLC 1.8.4a

have you tried a different file or options?

Code: Select all

function pl_play(){ document.stream1.play(); } function pl_pause(){ document.stream1.pause(); } function pl_stop(){ document.stream1.stop(); } </script> </head> <body onload="init()"> <div id="nowPlaying"> Loading... </div> <embed type="application/x-vlc-plugin" name="stream1" autoplay="no" loop="no" hidden="yes" target="http://www.di.fm/mp3/trance.pls" />