J
jen_designs
How do I create custom controls for an embeded video. I need stop,
play, pause, etc. Any thoughts?
play, pause, etc. Any thoughts?
Can anyone tell me why the stop function below does not work:
<html>
<head>
<title>Video Page</title>
<script type="text/javascript">
function stopVideo()
{
ourVideo.controls.stop();
}
</script>
</head>
<body bgcolor="#999999">
<OBJECT ID="ourVideo" WIDTH=320 HEIGHT=240
CLASSID="CLSID:05589FA1-C356-11CE-BF01-00AA0055595A">
<PARAM NAME="FileName" VALUE="crabs.avi">
</OBJECT>
<form name="myVideo">
<input type="button" value="Stop" onClick="stopVideo()">
</form>
</body>
</html>
See how I do it at http://www.cwdjr.info/media/playersRoot.php . You do
not need any javascript for the controls you want, as more powerful
code is built into either the WMP or Real player - both of which are
about 3 tomes the size of a small browser such as Firefox or Opera. If
you use only one media type I suggest .wmv with the corresponding .wax
redirector file as the WMP is the most common player. You can in
addition add a Real .rm video file with the corresponding .ram
redirector file if you want to be seen by the few who have only the
Real player. If no players are installed, the video controls will not
appear and the user of the browser will not even know that there is a
video on the page unless you give a statement to this effect.
The code you were attempting to use depends on an ActiveX object for
the WMP as indicated by the unique hex id for the WMP. Thus your video
could not be seen on a browser that does not have ActiveX installed for
the WMP, for example. Only IE browsers and the most recent Netscape
browsers come with ActiveX installed for the WMP. There are WMP ActiveX
plugins for some of the other browsers, but you can not count on their
being installed. Installing some of these requires a good bit of
effort, sometimes requiring changes in the registry. This perhaps is
more than you can expect casual computer users to do.
You also need to consider your audience. You can handle only about 30
kbps for streaming on dialup, and the image must be kept very small. If
you use a DSL or cable streaming bit rate, the video quality is much
better, but the buffering time for playing on dialup is very excessive
- often many minutes. Many commercial sites offer a choice of 2 or 3
streaming rates to overcome this problem.
The general object method I use works on recent versions of IE and
close relatives of it such as MSN9, Avant, and MyIE2. It also works on
recent versions of Mozilla, Firefox, Netscape, and Opera. If you use
the simple WMP method such as in the case of my WMP link on the page
quoted, you also have the advantage that the video likely will show
even with javascript turned off, as no script is used in the code. You
will have to allow enough height in the object for the video above the
control bar as I note on my page.
Although I used no javascript, I find that the video and control bar do
not show when script is turned off on Firefox, and likely all other
browsers. My guess is that the WMP is using script within the WMP
program, and Microsoft likely would use their Jscript.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.