I am currently using following binding in angularJS controller. I am having problem of the event being bound multiple times. Is there a way to bind events to a specific element?
Let's say I have 2 videos like this:
<video id="video1"></video>
<video id="video2"></video>
JS
This works
$(document).on('webkitfullscreenchange mozfullscreenchange fullscreenchange', function (e){
//Do stuff like unmute video
});
This doesn't work. I thought this should work.
$(document.getElementsByTagName("video")[0]).on('webkitfullscreenchange mozfullscreenchange fullscreenchange', function (e){
//Do stuff like unmute video
});