homepage Welcome to WebmasterWorld Guest from 184.73.104.82
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Browsers / Firefox Browser Usage and Support
Forum Library, Charter, Moderators: incrediBILL

Firefox Browser Usage and Support Forum

    
Controlling Windows Media Player with Firefox/Mozilla
.controls is void for Windows Media Player embedded object
smo47

5+ Year Member



 
Msg#: 127 posted 6:02 am on Jun 29, 2005 (gmt 0)

Hi,

In trying to embed and control the Windows Media Player in a somewhat browser independent way.

Using the following HTML


<embed src="test.wmv" name="MyMediaPlayer" controls="ImageWindow" autostart="0" showcontrols="0" height="200" width="320" />

I try to then control the player via javascript


document.MyMediaPlayer.controls.play();
document.MyMediaPlayer.controls.stop();

... etc...

This works fine and dandy in IE, but, in Firefox/Mozilla .controls is void. :(

I rummaged about and found a suggestion to try


document.MyMediaPlayer.play();

But Firefox reports that .play() is undefined. :(

Any ideas?

 

Robin_reala

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 127 posted 6:37 am on Jun 29, 2005 (gmt 0)

I'm no expert here, but I'm guessing that you're not callig the reference correctly. Try giving your <embed> id="MyMediaPlayer" then call it with:

document.getElemntById('MyMediaPlayer').controls.play();

smo47

5+ Year Member



 
Msg#: 127 posted 3:25 pm on Jun 29, 2005 (gmt 0)

Thanks for the response.

I'm not getting an undefined error on the reference to document.MyMediaPlayer

In the Javascript debugger I can see all the standard properties of document.MyMediaPlayer & .controls is void.

But for grins, I changed the embed as per your suggestion.


<embed src="test.wmv" name="MyMediaPlayer" id="MyMediaPlayer" controls="ImageWindow" autostart="0" showcontrols="0" height="200" width="320" />

I then looked at document.MyMediaPlayer and document.getElementById('MyMediaPlayer') using the debugger. They were the same object with .controls set to void.

Maybe it's the case that Microsoft does not give the <embed> object any access to .controls and requires ActiveX. :(

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Browsers / Firefox Browser Usage and Support
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved