1

I am added Youtube video in my website. In my site when we click on any element like

image, text etc a jquery ui dialogs open which contain that element properties. But this

behaviour is not working with youtube video , when i click over the video it just start

playing the video. I want to open a dialog on click over the embeded video. How can i do this?

King Kong
  • 2,855
  • 5
  • 28
  • 39

2 Answers2

3

The video itself is not an element in your DOM. And the video embedding container element is either not the same size as the video (likely just 0 px) or it is "behind" the video.

So, the embedding tag does some sort of work (I don't know the details) to pop the video player including controls into that space.

If you want to modify how the video is controlled, you need to look into its API (as I just noticed gdoron's comment popped up while I was typing!). You could layer an element over top of the video that listens for clicks, but in my opinion that is a hack and could potentially break other interactions.

Greg Pettit
  • 10,749
  • 5
  • 53
  • 72
  • I was writing the same thing, when I saw that you already finished it. :) When layering a absolute positioned element on top, you could somehow delegate the click event to the flash player in the iframe/object your video is in. – insertusernamehere Jun 19 '12 at 14:18
0

Maybe this can help: http://progproblems.blogspot.it/2009/08/javascript-onclick-for-flash-embeded.html

and also somehow duplicated here: javascript onclick event over flash object

Community
  • 1
  • 1
MaJac89
  • 151
  • 4