Reputation: 3332
It appears that click events do not fire on video
element media controls. The click event is fired as expected when you you click on the video "screen", but not on the controls. Am I missing something here?
How can I get the click event to fire when clicking on video element controls?
https://jsfiddle.net/v8mr2oet/
Upvotes: 2
Views: 1579
Reputation: 46
remove the "controls" attribute from "video" element and attach the click event, it will work.
Upvotes: 1
Reputation: 563
The click event only fires when an html element is clicked. The video itself is an element, but its controls are not. Depending on what you wish to accomplish, there are other events fired by the video that you can use:
https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Media_events
Upvotes: 3