473,473 Members | 2,316 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Creating customs controls for a embeded video

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

Sep 6 '05 #1
5 5434
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>

Sep 7 '05 #2
je*********@hotmail.com schrieb:
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();
Try
ourVideo.stop();
or
document.getElementById("ourVideo").stop();
something like this should work.
}
</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">


It isn't a very good idea to embed an avi-file. Better use WindowsMedia-,
RealMedia- or Quicktime-files. You can get free versions at least from
WindowsMedia Encoder and RealMedia-Encoder (aka helix producer) bei microsoft
and real, these free tools are limited in functionality but that's still much
better than embedding an avi.

And one other little thing to remember: When requesting help in a newsgroup,
please give a description of the problem, in this case, asking for help in
creating custom controls for *Windows Media Player" would bring up more answers
then first just asking a very general question and then pasting some code where
the people first have to search for the special problem (there's more then one
player that can get embedded!).

greetz

martin
Sep 8 '05 #3

je*********@hotmail.com wrote:
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.

Sep 8 '05 #4

cw******@yahoo.com wrote:
je*********@hotmail.com wrote:
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.


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.

Sep 8 '05 #5

cw******@yahoo.com wrote:
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.

Sep 9 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jack | last post by:
Hello everyone, I have an event the kicks off from way down inside a user control. It is 4-5 levels deep, i.e. me.parent.parent.parent.parent.parent is the main form. The event needs to be able...
9
by: C# Learner | last post by:
Here's a simple way to recreate my flicker problem. - Create a new project. - Put a ListBox on the form. - Resize it so that it can accompany 20 items. - Put a button on the form. -...
5
by: Ian Stiles | last post by:
I have tried everything under the sun to get rid of horrible flashing and flickering that occurs on a CSharp form when the form hosts a TreeView or WebBrowser control and then you resize the form....
1
by: chrisdude911 | last post by:
on http://www.w3schools.com/media/media_browservideos.asp it says that i can add a video. i have tested it and it is just a plain video with no controls. how do i add controls to the video box??
0
by: gaurav2325 | last post by:
Hi, I would like to create a plugin for internet explorer to run my document. My document contains specific type of data, so that, I want whenever the user open that document (that is word...
2
by: DotNetDev | last post by:
Hi I have a control (child2.ascx). Which I place in a repeater in another controls (child1.ascx). Child2.ascx is again placed in a repeater on a Page(Page1.aspx). What will be a good way to...
4
by: =?Utf-8?B?TWlrZQ==?= | last post by:
Just wondering if someone can help me out. I'm building a web app that uses UserControls for different forms etc. I have a few UserControls that are embeded and I want to be able to call/pass data...
2
by: =?Utf-8?B?U2hhbQ==?= | last post by:
Hai I want to create a thumbnail image from a video file by using c#, which is used to display a video file. Can anyone tell about this.
3
by: columbo1977 | last post by:
Hi All Hope someone can help, the attached file is a nav bar I have on my site, the problem I am having is that the menu is appearing behind the video. Can anyone help me sort this, I have...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.