0

Its not like this question has not been asked anywhere. But I need some specific implementation of the mentioned problem. I need to know if the 'video' tag has registered event handler or not in the application. I tried it using the jQuery methods but it simply does not work. I am new to jQuery, so may be I am doing it in a wrong way. Here is what I referred How to check if element has click handler?

var ev = $._data(element, 'events');

I implemented it like this

var ev = $._data($('video')[0], 'volumechange');

where $('video')[0] holds the HTML video tag.

The above query always returns

unidentified

So, where am I going wrong? My application has an event handler registered to it

<script>
video.addEventListener('volumechange', handleVideoEvent, false);
</script>

I expect

var ev = $._data($('video')[0], 'volumechange'); 

to return

handleVideoEvent object.

And moreover is jQuery the only way to get the registered event handlers. Is there a way in Javascript itself?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
TechTotie
  • 127
  • 1
  • 15
  • http://stackoverflow.com/questions/2741493/how-do-you-detect-html5-video-events – Vaibs_Cool Jul 24 '14 at 09:55
  • http://www.steveworkman.com/html5-2/javascript/2012/interacting-with-html5-video-players/ – Vaibs_Cool Jul 24 '14 at 09:56
  • Thanks Vaibs, but I think you got my question wrong. I don't need support to addeventlisteners to video. instead I need help to find out if an event has a registered event listener or not. – TechTotie Jul 24 '14 at 11:49

0 Answers0