Blog

  • Adding events in Kaltura

    Posted by Pulkit Chadha | Last Updated: 04-Oct-16

    In this blog I am going to explain how you can add events like video start, video complete ,ad cue point reached, ad start , ad complete etc.

    Step 1: First setup kaltura in your application.

                 <script src="http://cdnapi.kaltura.com/p/{pId}/sp/{partnerId}00/embedIframeJs/uiconf_id/{uiconfId}/partner_id/{partnerId}"></script>
         

    Step 2: write the code given below

                 
        kWidget.addReadyCallback(function (playerId) {
    
            var kdp = document.getElementById(playerId);
            
            //kBind method is used to add listener to the player to listen to specific events happened in the player, such as the video is playing or is paused. The opposite of it is kUnbind method.
    
    
            // This event triggeres once per video when first played.
            kdp.kBind("firstPlay", function () {
                console.log("video start");
            });
    
            // This event triggeres when video has reached the end of content playback.
            kdp.kBind("playerPlayEnd", function () {
                console.log("video complete");
            });
    
            //This event triggeres when the player's time progress reaches an ad cue point
            kdp.kBind("adOpportunity", function (qPoint) {
                console.log("adcuePointReached ", qPoint);
            });
    
            //This event triggeres when the ad starts to play.
            kdp.kBind("onAdPlay", function () {
                console.log("Ad start");
                var url = kdp.evaluate('{sequenceProxy.activePluginMetadata}').url;
            });
    
            //This event triggeres when video has reached the end of content playback.
            kdp.kBind("onAdComplete", function () {
                console.log("Ad complete");
                var url = kdp.evaluate('{sequenceProxy.activePluginMetadata}').url;
    
            });
        });
          

Tags: kaltura

View All PostsLeave a Comment
comments powered by Disqus

Mobile Applications

Video Content

Bigdata & NoSQL

SaaS Applications

Miscellaneous

Archives


Alexa Certified Site Stats for www.oodlestechnologies.com