whopub
02-08-2010, 06:53 PM
Hi,
I'm using an embedded video, which plays in IE, Firefox and Opera, but I need help to figure out a couple of things...
1st problem
The custom 'buttons' I put together (just regular images with 'onclick') only work in IE. Firefox and Opera just don't do anything. To play the video with those two I have to right click and pick 'play' using the context menu.
The code I'm using on my 'buttons' is:
<SCRIPT>
function play(pluma) { document.getElementById(pluma).play() }
function pause(pluma) { document.getElementById(pluma).pause() }
function stop(pluma) { document.getElementById(pluma).stop() }
</SCRIPT>
And then:
<EMBED TYPE="application/x-mplayer2" CLASSID="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6"
PLUGINSPAGE="http://www.microsoft.com/Windows/Mediaplayer/" SRC="video/pluma.mpg" ID="pluma" WIDTH="384" HEIGHT="288" ShowControls="0" ShowDisplay="0" ShowStatusBar="0" AutoStart="0" AutoRewind="1" ShowPositionControls="0" ShowTracker="0" FullScreen="0" ClickToPlay="1" AnimationAtStart="0" IMAGE="images/video/v_preview_pluma.jpg"></EMBED>
<INPUT TYPE="image" SRC="../images/video/pb_c_1play_out.jpg" WIDTH="36" HEIGHT="37" OnClick="play('pluma')">
<INPUT TYPE="image" SRC="../images/video/pb_c_2stop_out.jpg" WIDTH="36" HEIGHT="37" OnClick="stop('pluma')">
<INPUT TYPE="image" SRC="../images/video/pb_c_3pause_out.jpg" WIDTH="36" HEIGHT="37" OnClick="pause('pluma')">
Here's the error console message from Firefox:
Error: [Exception... "'JavaScript component does not have a method named: "onLocationChange"' when calling method: [nsIWebProgressListener::onLocationChange]" nsresult: "0x80570030 (NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED)" location: "<unknown>" data: no]
And from Opera:
JavaScript - file://localhost/...
Event thread: click
Error:
name: TypeError
message: Statement on line 2: Type mismatch (usually non-object value supplied where object required)
stacktrace: n/a; see opera:config#UserPrefs|Exceptions Have Stacktrace
Any ideas on how to fix things to make sure those buttons work with those browsers too?
2nd problem
Is there any way to use an image as a placeholder, on top of the player, instead of its black screen, just to serve as a cover of sorts, representing the video until the user click on the 'play' button?
Thanks.
I'm using an embedded video, which plays in IE, Firefox and Opera, but I need help to figure out a couple of things...
1st problem
The custom 'buttons' I put together (just regular images with 'onclick') only work in IE. Firefox and Opera just don't do anything. To play the video with those two I have to right click and pick 'play' using the context menu.
The code I'm using on my 'buttons' is:
<SCRIPT>
function play(pluma) { document.getElementById(pluma).play() }
function pause(pluma) { document.getElementById(pluma).pause() }
function stop(pluma) { document.getElementById(pluma).stop() }
</SCRIPT>
And then:
<EMBED TYPE="application/x-mplayer2" CLASSID="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6"
PLUGINSPAGE="http://www.microsoft.com/Windows/Mediaplayer/" SRC="video/pluma.mpg" ID="pluma" WIDTH="384" HEIGHT="288" ShowControls="0" ShowDisplay="0" ShowStatusBar="0" AutoStart="0" AutoRewind="1" ShowPositionControls="0" ShowTracker="0" FullScreen="0" ClickToPlay="1" AnimationAtStart="0" IMAGE="images/video/v_preview_pluma.jpg"></EMBED>
<INPUT TYPE="image" SRC="../images/video/pb_c_1play_out.jpg" WIDTH="36" HEIGHT="37" OnClick="play('pluma')">
<INPUT TYPE="image" SRC="../images/video/pb_c_2stop_out.jpg" WIDTH="36" HEIGHT="37" OnClick="stop('pluma')">
<INPUT TYPE="image" SRC="../images/video/pb_c_3pause_out.jpg" WIDTH="36" HEIGHT="37" OnClick="pause('pluma')">
Here's the error console message from Firefox:
Error: [Exception... "'JavaScript component does not have a method named: "onLocationChange"' when calling method: [nsIWebProgressListener::onLocationChange]" nsresult: "0x80570030 (NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED)" location: "<unknown>" data: no]
And from Opera:
JavaScript - file://localhost/...
Event thread: click
Error:
name: TypeError
message: Statement on line 2: Type mismatch (usually non-object value supplied where object required)
stacktrace: n/a; see opera:config#UserPrefs|Exceptions Have Stacktrace
Any ideas on how to fix things to make sure those buttons work with those browsers too?
2nd problem
Is there any way to use an image as a placeholder, on top of the player, instead of its black screen, just to serve as a cover of sorts, representing the video until the user click on the 'play' button?
Thanks.