I want to check if an event is available or not before binding the function to it. The problem is that Google Chrome supports the "uploaded metadata" event in the "Video" element, but FireFox does not.
I did the following
$('video').bind('loadedmetadata', videoloaded);
videoloaded();
This works well in Firefox, but when I tried in Chrome, the function ran twice (which is logical). I want to check if an event handler exists loadedmetadataor not, to run the function only once in each browser.
If such an opportunity does not exist, is there any intellectual work for this?
source
share