472,971 Members | 1,940 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,971 software developers and data experts.

Firefox change video from onchange javascript

Video selector works for IE but not other browsers.

for not IE

<object ID='Player' data="video/dodgeball.wmv" type="video/x-ms-wmv"
width="320" height="280">
<param name="filename" value="video/dodgeball.wmv" />
<param name="ShowControls\" value="1" />
<param name="AutoStart\" value="1" />
<param name="PlayCount\" value="1" />
</object>";

for IE
<Object ID='Player' width=320 height=280
ClassID='CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95'Type='applicaton/x-oleobject'><Embed
Type ='application/x-mplayer2'Src='null.wvx'Name='Player'
showtracker='-1' showcontrols='true' autostart='true' showdisplay='0'
showstatusbar='-1'</Embed></Object>
In javascript I do this.
function PlayVideo(fName){

document.Player.filename = fName;
document.Player.data = fName;
document.Player.play();
}

function GetSelection (selSelectObject){
data =
selSelectObject.options[selSelectObject.selectedIndex].getAttribute('value');

//data = selSelectObject.options[selSelectObject.selectedIndex].value;
PlayVideo(data);
}
<SELECT name=VideoList onchange="GetSelection(this)"
onkeydown="window.setTimeout(function(e0){return function()
{GetSelection(e0)}}(this),0)" >
<option selected value=null>Choose A Video</option>
.. . . . .
</select>

Jun 4 '06 #1
1 7573

ri***********@gmail.com wrote:
Video selector works for IE but not other browsers.

for not IE

<object ID='Player' data="video/dodgeball.wmv" type="video/x-ms-wmv"
width="320" height="280">
<param name="filename" value="video/dodgeball.wmv" />
<param name="ShowControls\" value="1" />
<param name="AutoStart\" value="1" />
<param name="PlayCount\" value="1" />
</object>";

for IE
<Object ID='Player' width=320 height=280
ClassID='CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95'Type='applicaton/x-oleobject'><Embed
Type ='application/x-mplayer2'Src='null.wvx'Name='Player'
showtracker='-1' showcontrols='true' autostart='true' showdisplay='0'
showstatusbar='-1'</Embed></Object>
In javascript I do this.
function PlayVideo(fName){

document.Player.filename = fName;
document.Player.data = fName;
document.Player.play();
}

function GetSelection (selSelectObject){
data =
selSelectObject.options[selSelectObject.selectedIndex].getAttribute('value');

//data = selSelectObject.options[selSelectObject.selectedIndex].value;
PlayVideo(data);
}
<SELECT name=VideoList onchange="GetSelection(this)"
onkeydown="window.setTimeout(function(e0){return function()
{GetSelection(e0)}}(this),0)" >
<option selected value=null>Choose A Video</option>
. . . . .
</select>


For starters, you have a problem with your objects for the WMP. The one
labeled as for IE actually is an ActiveX object for the WMP for the IE
with an embed path within it for non-IE browsers. If you use the code
you have here, and it is correct, you do not need the not IE object,
and it well could be causing a conflict. Although the ActiveX object
with the embed path often is used and will work, it is not proper
modern html where embed is not an official W3C tag and never has been.

I will repeat part of my answer to another thread concerning the WMP
and Firefox below, as it shows that only a single object using valid
code will serve for most common recent browsers.
If at all possible, avoid trying to control the WMP with script.
First,
embed has never been an official tag, and object is the modern method.
Of course many sites still use tag soup with an ActiveX object for IE
and an embed path within the AE object for most other browsers that do
not support AE. You will find the W3C validator does not like this soup
or use of a simple embed tag.

The WMP has many controls built in that can be specified in a correct
object tag, so it usually is not necessary to make your own controls
using script or whatever.

Go to a page of mine at
http://www.cwdjr.info/broadbandMedia.../cancanWMV.php and look
at the object code that inserts the WMP with controls. This video uses
a very high variable bit rate wmv video file, so it may not stream on
dialup without an extremely long buffering time. The average bit rate
is about 1919 kbps. You will notice that the object for the video calls
for a .wvx file which is a redirector file; the actual video file is a
..wmv file. The .wvx file has a simple XML structure that points to the
..wmv file, and the one used in this example is:

<ASX VERSION="3.0">
<ENTRY>
<REF HREF="http://www.cwdjr.info/movie/CanCanvbr.wmv" />
</ENTRY>
</ASX>

On broadband, that will allow about 2.5 Mbps, buffering of the above
sample is quite fast, and you can click on the video shortly when
buffering is completed. For good dialup, you would need a video
recorded at not more than about 30 kbps, and the image would need to be
kept quite small. Even so, streaming video leaves much to be desired on
dialup. My example works on most recent popular browsers with the WMP
installed including IE6, Opera, and the Mozilla family(Firefox,
Mozilla, Netscape).

If you absolutely must use script to control the WMP, there used to be
some information somewhere on the Microsoft developers sites. However,
if I remember correctly, some of the uses of script discussed there
used Microsoft Jscript, some examples were designed to work on ActiveX
objects that often are not supported by non-IE browsers, and some
scripts to detect the WMP and version used vb script that does not work
on many non-IE browsers. One likely could spend days at Microsoft
developer sites finding scripts and testing, and often changing them
for non-IE browsers.

I have used code to make a menu of about 20 audio selections down the
right side of a page. I used a document.write in a loop to write an
object for the WMP for each player so you do not have to write so much
by hand. The size of the player was kept small so that each player was
just a small on-off selection button generated by the WMP. Of course
this would have to be modified for video because the video object
requires a fairly large area, and you would not want to string 20 large
players with controls down the right of the page.

Jun 4 '06 #2

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

Similar topics

5
by: Craig Keightley | last post by:
Please help, i have attached my page which worksin IE but i cannnot get the drop down menu to fucntion in firefox. Any one have any ideas why? Many Thanks Craig ...
5
by: Pascal Batzli Jr | last post by:
Hello, I have a strange situation happening on the code below. When I first load the page, as I change any of the three combo boxes I have created, the onchange event is fired and the form should...
4
by: David McNerney | last post by:
Would anyone be able to tell me why I get an error in FireFox 1.5.0.1 for MacOSX when I type some text and hit Enter in the following form: <html> <body> <form action="http://example.com"...
5
by: JulioHM | last post by:
Hi all, I'm trying to use WMP in FireFox and I have the following tag to embed the player into the html page. <EMBED TYPE="application/x-mplayer2" ...
7
by: Coder | last post by:
Hi I have the following code in java script, it is not giving proper output in FIREFOX but running fine in IE... can anybody help me out to make this run in FIREFOX . <script...
3
by: Bruno Alexandre | last post by:
Hi guys, I'm performing a form validation using the javascript in the ASPX pages and I got into a part that I can't figure it out how to move foward. All is resumed in this page: ...
10
by: david.bercot | last post by:
Hi, I have a big problem with a simple event : onchange !!! If I write this page : <html> <body> <form id="vu"> <input id="var01" name="var01" size="5" onchange="return false;"/> </form>...
9
by: johnd126 | last post by:
I have a cgi program which outputs a fairly hefty amount of html/javascript for doing a complex slide show sorta thing in a variety of areas in the browser. I accomplish this by creating a series...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.