views:

88

answers:

1

Problem: Need onclick event to pause/unpause a Youtube video, but impossible to add the evenlistener. Looks to me that the object is 'unclickable'.

Situation: Got a Youtube player initialized by swfobject, onYouTubePlayerReady is build as suggested in the docs (Google API docs) For HTML & JS see: http://ListAndPlay.com

What I tried: almost everything, from changing doctypes till forcing ID's while adding the eventlisteners, nothing worked.

I hope that one of you see the flaw I made after hours...

+1  A: 

i had the same problem before and -i think- i read somewhere in Jquery wiki that object doesn't fire any event because once you click on it you are inside flash object.

as an alternative solution i used a div with z-index:100 and placed it in front of the object and then you can use on click event when the client clicks on that div

i hope this helps

From.ME.to.YOU
Thnx for your reaction! That is indeed a good explanation. Let's see if someone else solved it in another way :)
MeProtozoan