Mozilla Plugin Acting Strange (may be Javascript Issues)
Posted: 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:
This works just fine. The PHP file I use outputs the following on FF:
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.
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 />
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>
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.