Hello,
I’m creating a custom plugin for Kaltura player. I found an issue with event triggering. When I test events with kWidget:
kWidget.addReadyCallback( function( playerId ){ var kdp = document.getElementById(playerId); var events = ['layoutBuildDone', 'playerReady', 'mediaLoaded', 'mediaError', 'playerStateChange', 'firstPlay', 'playerPlayed', 'playerPaused', 'preSeek', 'seek', 'seeked', 'playerUpdatePlayhead', 'openFullScreen', 'closeFullScreen', 'volumeChanged', 'mute', 'unmute', 'bufferChange', 'cuePointReached', 'playerPlayEnd', 'onChangeMedia', 'onChangeMediaDone']; for ( var i=0; i < events.length; i++ ){ (function(i) { kdp.kBind( events[i], function(event){ console.log('Kaltura player event triggered: ' + events[i] + ', event data: ' + JSON.stringify(event)); }); })(i); }
});
The events are calling fine. But when I’m trying to achieve that from plugin level:
window.mw.kalturaPluginWrapper(function(){
this.PluginManager.add(‘PrizmaEndSlate’, this.KBaseComponent.extend({
setup: function(){
var events = [‘layoutBuildDone’, ‘playerReady’, ‘mediaLoaded’, ‘mediaError’, ‘playerStateChange’, ‘firstPlay’, ‘playerPlayed’, ‘playerPaused’, ‘preSeek’, ‘seek’, ‘seeked’, ‘playerUpdatePlayhead’, ‘openFullScreen’, ‘closeFullScreen’, ‘volumeChanged’, ‘mute’, ‘unmute’, ‘bufferChange’, ‘cuePointReached’, ‘playerPlayEnd’, ‘onChangeMedia’, ‘onChangeMediaDone’];
events.forEach(this.checkEvent.bind(this));
},
checkEvent: function(name){
this.bind(name, function(){
console.log(333, name, arguments);
});
}
}));
});
I only get couple of them. For example there is no playerStateChange event at all. Is there a way to register to all player’s events?