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
https://forums.phpfreaks.com/topic/12753-control-media-player-with-javascript/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.