Jump to content

control media player with javascript


michaellunsford

Recommended Posts

I've read Microsoft's documentation and have searched google. Everything I read says that you can stop a media player movie simply by javascripting "player.controls.stop()"

the "player" part is just the "id" you assign in the object tag. Problem is, it simply does not work. I have run it through the javascript console in firefox, which reports:

document.movie1.controls has no properties

If I pull out "controls" I get "document.movie1.stop" is not a function

if I remove the () from the end of stop, I get no error, but nothing happens.

putting back the controls but leaving off the () returns the "is not a function" again.

Has anyone run into this before? It is extreemly frustrating.


before you ask, it was also tested in internet explorer on Windows XP, and on Safari for mac. None of them like it... in fact, Safari's javascript console says "TypeError - Undefined value". what internet explorer thinks is anyone's guess.

EDIT: Also, document.getElementById('movie1')... reports just like document.movie1...

EDIT2: found out what internet explorer thinks "Error: 'movie1.controls' is null or not an object" adding "document." to the front only adds "document." to the error message.

If you can help, you'll be my hero.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.