Search code examples
javascriptkaltura

Kaltura: Cuepoints not triggered instantly


I am using kaltura dynamic embed player in my application, there user can set cue points to video. When i set any cue point on video,it is not reflected on player instantly. Sometimes, it takes 2 or 3 min to reflect. We are giving a preview functionality, so that's why i need it instantly.

Add cuepoints on kaltura

var cuePoint = new kaltura.kc.objects.KalturaAdCuePoint();
        cuePoint.entryId = entryId;
        cuePoint.startTime = startTime;
        cuePoint.title = title;
kalturaClient.cuePoint.add(function(results) {
                callback(results);
            });

Events to listen cue points

kWidget.embed({
        'targetId': 'embedPlayer',
        'wid': '',
        'uiconf_id' : '',
        'entry_id' : entry_id,
        'flashvars':{  
            'autoPlay': false,
        },
        height:height,
        width:width,
        'readyCallback': function( playerId ){
            console.log( "kWidget player ready: " + playerId );
            player = $( '#' + playerId ).get(0);
            player.kBind( "adOpportunity", "cuePointReached");
        }
    })

var cuePointReached = function(qPoint){
    console.log("cuePointReached " + qPoint)
}

I just want to know, is it a behaviour of kaltura or i am doing something wrong ?

Thanks in advance


Solution

  • We can override cue point data at run time.

    <script>
        kWidget.embed({
            'targetId': 'kaltura_player',
            'wid': '_243342',
            'uiconf_id' : '13306622',
            'entry_id' : '0_uka1msg4',
            'flashvars': {
                'vast': {
                    'trackCuePoints': true
                },
                'mediaProxy':{
                    'entry':{
                        'name':"This shows partial runtime override of entry name"
                    },
                    'entryCuePoints': [{
                        "protocolType": 1,
                        "adType": 1, 
                        "cuePointType": "adCuePoint.Ad",
                        "startTime": 5000,
                        "sourceUrl": "http://projects.kaltura.com/mdale/hotelVastAd.xml"
                    }]
                }
            },
        })
    </script>