Skip to content

Latest commit

 

History

History
23 lines (21 loc) · 978 Bytes

API_EVENTS.md

File metadata and controls

23 lines (21 loc) · 978 Bytes

Events API

You can listen to several events from Clappr.

// You can either listen some events this way
var player = new Clappr.Player({
  events: {
    onReady: function() { ... }, //Fired when the player is ready on startup
    onResize: function() { ... },//Fired when player resizes
    onPlay: function() { ... },//Fired when player starts to play
    onPause: function() { ... },//Fired when player pauses
    onStop: function() { ... },//Fired when player stops
    onEnded: function() { ... },//Fired when player ends the video
    onSeek: function() { ... },//Fired when player seeks the video
    onError: function() { ... },//Fired when player receives an error
    onTimeUpdate: function() { ... },//Fired when the time is updated on player
    onVolumeUpdate: function() { ... },//Fired when player updates its volume
  }
})
// or this way
player.on(Clappr.Events.PLAYER_PLAY, function() { ... })