Last active
February 24, 2021 16:58
-
-
Save arturparkhisenko/21d2aa8ecfcab4085ac938dfd0a04cd8 to your computer and use it in GitHub Desktop.
mediaevents listener
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://html.spec.whatwg.org/multipage/media.html#mediaevents | |
const events = [ | |
'loadstart', | |
'progress', | |
'suspend', | |
'abort', | |
'error', | |
'emptied', | |
'stalled', | |
'loadedmetadata', | |
'loadeddata', | |
'canplay', | |
'canplaythrough', | |
'playing', | |
'waiting', | |
'seeking', | |
'seeked', | |
'ended', | |
'durationchange', | |
'timeupdate', | |
'play', | |
'pause', | |
'ratechange', | |
'resize', | |
'volumechange' | |
]; | |
function listen(domElement){ | |
events.forEach(eventName => { | |
domElement.addEventListener(eventName, event => { | |
console.log(eventName, event); | |
}) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment