Creating customs controls for a embeded video

J

jen_designs

How do I create custom controls for an embeded video. I need stop,
play, pause, etc. Any thoughts?
 
J

jen_designs

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>
 
C

cwdjrxyz

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.
 
C

cwdjrxyz

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.

Here is a simple demo for you at
http://www.cwdjr.info/media/streamVideoWMP.html . It is an awful
quality experimental clip from an old silent film, but it will do for a
demo. I streamed it at a very low rate so that most on dialup can view
it without undue buffering time, and this is part of the reason for the
poor quality. This is just the bare bones object code that you can see
by right clicking. I just used html 4.01 strict for this demo. The page
I quoted in my last post shows you how to write the .wax redirector
file that points to the .wmv file that contains the video.

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.

That WMP player is huge, and in many respects it is more like a browser
than an add-on program. I even find that I get records of visits from
the WMP and Real players at my domain rather than visits for the
browser being used at the time.
 
C

cwdjrxyz

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.

The situation is completely different when you use the Real player
rather than the WMP. If you turn off javascript for the browser, the
Real player still pops up and plays normally using either the classic
ram files or using SMIL. Unlike the WMP, the Real player apparently
does not use internal script that depends on the settings of the
browser.

The Real player will play many more file types than the WMP also,
including the Windows audio and video files as well as support most of
W3C SMIL2. The unfortunate thing is that many more computers have the
WMP installed than have the Real player installed. However there is
nothing to prevent you from offering both Windows and Real versions of
audio and video files on a web page.

The Real player does act strange in one respect. It will play both
Windows audio and video files locally on the computer. However, when
you stream the media from a server, the audio files are played
normally, but only the audio portion of a Windows video file is played.
I so far have not been able to find out what is causing this strange
action. Of course you can overcome this problem by providing a Real
video file for the Real player.
 

Ask a Question

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.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top