Jump to content


Photo

control media player with javascript


  • Please log in to reply
No replies to this topic

#1 michaellunsford

michaellunsford
  • Members
  • PipPipPip
  • Advanced Member
  • 1,023 posts
  • LocationLouisiana, USA

Posted 23 June 2006 - 07:49 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users