Event listener(s) can be set on the init config events (when the player is being created and initialized via createAndInitPlayer).
Types to pass to events:
object defining specific event listenersfunction which listens for all player eventsPass an object to the events config whose property names (see PlayerApiEvents) are the specific events to listen for, (see example):
var player = TOP.createAndInitPlayer({
events: {
playerReady : function(result) {
// Only triggered when player is initialized and ready to play
},
...
}
});Pass a function to the events config. This function will be triggered by all player events (see example):
var player = TOP.createAndInitPlayer({
events: function(type, result)
{
// All player events will fire here
}
});Also see PlayerEventType enum to check the type parameter for the type of event (see source code for example).