473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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 7602

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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.