Created
August 8, 2016 13:16
-
-
Save dmlap/16bcfdd1a3bb7e075d7682e0a90aa1a5 to your computer and use it in GitHub Desktop.
Listen (and stop listening) to player events.
This file contains hidden or 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
var player = videojs('player'); | |
// an event listener is a function that (optionally) takes an event argument | |
function playingListener(event) { | |
console.log('Look at me, I know how to listen for video events!', event); | |
} | |
// register the event listener | |
player.on('playing', playingListener); | |
// unregister the listener | |
player.off('playing', playingListener); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment