Last active
November 17, 2016 00:49
-
-
Save gkweb/f609cc05555fc07d4a59fe0c64360675 to your computer and use it in GitHub Desktop.
HTML 5 Video debug events
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
// Debug HTML5 Video or Audio events | |
// Assign multiple events | |
let media = document.getElementById('somevideo') | |
'canplay canplaythrough durationchange emptied error loadstart loadedmetadata playing pause seeked suspend stalled timeupdate volumechange waiting'.split(' ').forEach(e => { | |
media.addEventListener(e, event => { | |
console.log('Event fired') | |
console.log(event.type) | |
console.log(event) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment