Resume the video after ks is updated to entry id

3 replies [Last post]
Joined: 12/21/2012
Points: 12

This is my code to set ks after freepreviewperiod:

kdp.setKDPAttribute( 'servicesProxy.kalturaClient', 'ks', response );
kdp.sendNotification('changeMedia', {entryId: '1_p5z4aukt'});
kdp.addJsListener('doSeek', 'doSeekEvent');

function doSeekEvent() {
kdp.removeJsListener('doSeek', 'doSeekEvent');
kdp.sendNotification('doSeek', 10);
kdp.sendNotification( 'doPlay' );
}

If there is no seek, just simply send notification as doplay video plays well.
But if seek event needed, it is not playing. Manually I am clicking on play button. So that video is playing from starting point.

Please get rid of this issue.

Joined: 02/22/2009
Points: 76

The bug is not entirely clear to me. Do you have a sample page?

Joined: 12/21/2012
Points: 12

Thanks for your reply.

In some browsers, it not resuming(Chrome, Safari).

Sample is below:
------------------------

Kaltura/Evergent Demo

window.addEventListener('message', evpw_receiver, false);
function evpw_receiver(e) {
if (e.origin == 'http://xxx:7073') {
if (e.data == 'Transaction successful') {
if (!$('#kaltura_player_1').attr('type')) {
runPlaybackWithValidatedKS();
} else {
$.ajax({
url : "http://xxx/createks?jsoncallback=&entryid=1_p5z4aukt&partnerid=*****",
dataType : 'jsonp',
jsonp : 'jsoncallback',
success : function(data, status) {
var response = data.flashvars;
$('.myPurchaseDialog').remove();
document.getElementById("kaltura_player_1").tryPlay(response);
},
error:function (data, status, error) {
$('.myPurchaseDialog').html( data.error);
}
})
}
} else {
alert(e.data);
}
} else {
alert("Message came from: " + e.origin);
}
}
mw.setConfig( 'KalturaSupport.LeadWithHTML5' , true );
function jsCallbackReady(objectId) {
window.kdp = document.getElementById(objectId);
}
function doPurchaseDialog(){
var pos = $('#kaltura_player_1').position();
$('#kaltura_player_1').after(
$('').append(
)
.addClass('myPurchaseDialog')
)
$('.myPurchaseDialog').html("");
myKdp.removeJsListener( 'freePreviewEnd', 'doPurchaseDialog' );
}
kWidget.embed( 'kaltura_player_1', {
'wid': '*****',
'uiconf_id' : '******',
'entry_id' : '1_p5z4aukt',
'flashvars':{
'disableAlerts': true
},
'params' : {
'wmode' : 'opaque'
},
'readyCallback': function( playerId ){
myKdp = $('#' + playerId)[0];
myKdp.addJsListener( 'freePreviewEnd', 'doPurchaseDialog' );
}
});
function runPlaybackWithValidatedKS(){
window['onDoSeek'] = function(){
kdp.sendNotification( 'doPlay' );
setTimeout(function(){
kdp.sendNotification( 'doPlay' );
},1000);
};
$.ajax({
url : "https://xxx/register/createks?jsoncallback=&entryid=1_p5z4aukt&partnerid=******",
dataType : 'jsonp',
jsonp : 'jsoncallback',
success : function(data, status) {
var response = data.flashvars;
kdp.setKDPAttribute( 'servicesProxy.kalturaClient', 'ks', response );
$('.myPurchaseDialog').remove();
kdp.sendNotification('changeMedia', {entryId: '1_p5z4aukt'});
kdp.addJsListener('playerSeekEnd', 'onDoSeek' );
kdp.sendNotification('doSeek', 11);
kdp.sendNotification('doPlay');
},
error:function (data, status, error) {
$('.myPurchaseDialog').html( data.error);;
}
})
}

Joined: 02/22/2009
Points: 76

Would it be possible to plop the page onto drop box or otherwise public location, this ensures we are looking at exactly the same thing.