Mozilla Plugin Acting Strange (may be Javascript Issues)

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
NeppyMan
New Cone
New Cone
Posts: 2
Joined: 03 Feb 2006 17:25

Mozilla Plugin Acting Strange (may be Javascript Issues)

Postby NeppyMan » 03 Feb 2006 17:40

I'm working on using the VLC plugin to embed a streaming video viewer. I'm using PHP to handle browser detection (to decide between the ActiveX and FF plugins), and I'm running into a brick wall. This is the code from a test HTML page that I used to see if the FF plugin work work:

Code: Select all

<EMBED TYPE="application/x-vlc-plugin" NAME="stream" AUTOPLAY="yes" LOOP="no" WIDTH="320" HEIGHT="240" TARGET="http://127.0.0.1:8800/" /> <br /> <INPUT TYPE="button" value="Start Stream" onclick='document.stream.play();'> <INPUT TYPE="button" value="Stop Stream" onclick='document.stream.stop();'><br /> (double-click video image to go to full-screen playback, double-click returns)<br />
This works just fine. The PHP file I use outputs the following on FF:

Code: Select all

<TABLE BORDER="2" BGCOLOR="#000000"><TR><TD HEIGHT="480" WIDTH="720"> <EMBED TYPE="application/x-vlc-plugin" NAME="stream" AUTOPLAY="yes" LOOP="no" WIDTH="720" HEIGHT="480" TARGET="http://127.0.0.1:8800/" /> </TD></TR></TABLE><TABLE BORDER="2" BGCOLOR="#AAAAAA"><TR ALIGN="center"><CENTER> <TD><INPUT TYPE="button" VALUE="Play Stream" onclick="document.stream.play();"></TD> <TD><INPUT TYPE="button" VALUE="Stop Playing" onclick="document.stream.stop();"></TD> <TD>Mute<INPUT TYPE="checkbox" VALUE="Mute" onclick="document.stream.mute();"></TD> <TD>Volume</TD><TD>0<INPUT TYPE="radio" NAME="volume" VALUE="0" onclick="document.stream.set_volume(0);"></TD> <TD>25<INPUT TYPE="radio" NAME="volume" VALUE="25" onclick="document.stream.set_volume(50);"></TD> <TD>50<INPUT TYPE="radio" NAME="volume" VALUE="50" onclick="document.stream.set_volume(100);" CHECKED></TD> <TD>75<INPUT TYPE="radio" NAME="volume" VALUE="75" onclick="document.stream.set_volume(150);"></TD> <TD>100<INPUT TYPE="radio" NAME="volume" VALUE="100" onclick="document.stream.set_volume(200);"></TD> </TR></TABLE>
This doesn't work, and FF's Javascript console says that document.stream.play doesn't exist. As far as I can tell, the two snippets are absolutely identical. Now, for IE, the Start and Stop buttons don't throw errors, but the mute and volume controls do (and don't work).

Like the title says, I suspect this is a Javascript error on my part, but I'm not sure. Also, I'm sure people would like to see some examples of how to use the FF plugin in action. I can post the IE code too, if people would like, and even the PHP browser stuff. I'm looking mostly for a second pair of eyes here. :wink:

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 » 04 Feb 2006 17:08

What happens if you don't put it inside of a table?

NeppyMan
New Cone
New Cone
Posts: 2
Joined: 03 Feb 2006 17:25

Postby NeppyMan » 06 Feb 2006 17:11

After further testing, it seems to be a very strange error, although I still haven't figured it out. When the PHP file renders, the output doesn't work properly (it throws the Javascript function not found error). Interestingly enough, if the HTML (as received by the browser) is copied and pasted into an HTML file... it works perfectly. This is mind-boggling. The code above will work perfectly (table or otherwise) in an HTML file (so feel free to yoink it if you want).

I'd love to know why FF (and IE) render a .PHP file different from an .HTML file... especially when everything - including the HTML headers - are identical. Blargh.

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 » 08 Feb 2006 00:11

Can you post the two files (or samples of this effect) at ftp://streams.videolan.org/incoming ?

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

Postby ken » 01 Mar 2006 01:38

or place the embed command in a valid table, the DOM only allows table descriptor tags inside the table tag [CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+]. you might want to fix the html and see if that helps. I wouldn't be surprised if Javascript can't find your embed tag in the DOM and as such the "stream" property isn't recognized.


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 14 guests