Problem controlling embedded VLC in FF 1.5

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
Mikeman

Problem controlling embedded VLC in FF 1.5

Postby Mikeman » 15 Feb 2006 13:07

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

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Postby dionoea » 15 Feb 2006 13:19

does document.getElementById("VLCPlayer").pause() work ?
Antoine Cellerier
dionoea
(Please do not use private messages for support questions)

Mikeman

Postby Mikeman » 15 Feb 2006 13:38

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?

Mikeman

Postby Mikeman » 15 Feb 2006 14:09

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

Guest

Postby Guest » 15 Feb 2006 19:46

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>

Mikeman

Postby Mikeman » 16 Feb 2006 10:09

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

tonsofpcs
Cone that earned his stripes
Cone that earned his stripes
Posts: 363
Joined: 04 Jan 2006 10:03
Location: Binghamton, NY, USA
Contact:

Postby tonsofpcs » 16 Feb 2006 16:57

use both name and ID.

Mikeman

Postby Mikeman » 20 Feb 2006 12:36

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

tonsofpcs
Cone that earned his stripes
Cone that earned his stripes
Posts: 363
Joined: 04 Jan 2006 10:03
Location: Binghamton, NY, USA
Contact:

Postby tonsofpcs » 20 Feb 2006 19:40

Haven't tried, just looking and guessing on the way out the door, but what about inserting ; after the commands?

Mikeman

Postby Mikeman » 21 Feb 2006 09:24

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

ken
Blank Cone
Blank Cone
Posts: 12
Joined: 18 Feb 2006 03:55

Postby ken » 01 Mar 2006 01:21

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


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 5 guests