2 instanceOf:'kplayerEmbed',
12 getEmbedHTML : function () {
13 var embed_code = this.getEmbedObj();
16 setTimeout(function(){
19 js_log( "return embed html" );
20 return this.wrapEmebedContainer( embed_code );
22 getEmbedObj:function() {
23 var player_path = mv_embed_path + 'libEmbedVideo/binPlayers/kaltura-player';
24 return '<object width="' + this.width + '" height="' + this.height + '" '+
25 'data="' + player_path + '/wrapper.swf" allowfullscreen="true" '+
26 'allownetworking="all" allowscriptaccess="always" '+
27 'type="application/x-shockwave-flash" '+
28 'id="' + this.pid + '" name="' + this.pid + '">'+
29 '<param value="always" name="allowScriptAccess"/>'+
30 '<param value="all" name="allowNetworking"/>'+
31 '<param value="true" name="allowFullScreen"/>'+
32 '<param value="#000000" name="bgcolor"/>'+
33 '<param value="wrapper.swf" name="movie"/>'+
35 'kdpUrl=' + player_path + '/kdp.swf' +
36 '&ks=dummy&partner_id=0&subp_id=0' +
37 '&uid=0&emptyF=onKdpEmpty&readyF=onKdpReady' +
40 '<param value="opaque" name="wmode"/>'+
43 postEmbedJS:function() {
47 if( this.kdp && this.kdp.insertMedia){
50 //this.kdp.addJsListener("doPlay","kdpDoOnPlay");
51 //this.kdp.addJsListener("doStop","kdpDoOnStop");
52 //myKdp.addJsListener("fastForward","kdpDoOnFF");
54 _this.bindKdpFunc( 'doPause', 'kdpPause' );
55 _this.bindKdpFunc( 'doPlay', 'play' );
56 _this.bindKdpFunc( 'playerPlayEnd', 'onClipDone' );
58 // KDP player likes an absolute url for the src:
59 var src = mw.absoluteUrl( _this.getSrc() );
60 js_log('play src: ' + src);
62 this.kdp.insertMedia("-1", src, 'true' );
63 this.kdp.dispatchKdpEvent('doPlay');
68 js_log('insert media: not defiend' + typeof this.kdp.insertMedia );
69 setTimeout( function(){
77 * @param {String} flash binding name
78 * @param {String} function callback name
80 bindKdpFunc:function( bName, fName ){
81 var cbid = fName + '_cb_' + this.id.replace(' ', '_');
82 eval( 'window[ \'' + cbid +'\' ] = function(){$j(\'#' + this.id + '\').get(0).'+ fName +'();}' );
83 this.kdp.addJsListener( bName , cbid);
89 if( this.kdp && this.kdp.dispatchKdpEvent )
90 this.kdp.dispatchKdpEvent('doPlay');
94 this.kdp.dispatchKdpEvent('doPause');
97 doSeek:function( prec ){
100 var seek_time = prec * this.getDuration();
101 this.kdp.dispatchKdpEvent('doSeek', seek_time);
102 // Kdp is missing seek done callback
103 setTimeout(function(){
104 _this.seeking= false;
109 updateVolumen:function( perc ) {
110 if( this.kdp && this.kdp.dispatchKdpEvent )
111 this.kdp.dispatchKdpEvent('volumeChange', perc);
114 if( this.kdp && this.kdp.getMediaSeekTime ){
115 this.currentTime = this.kdp.getMediaSeekTime();
117 this.parent_monitor();
119 // get the embed fla object
120 getKDP: function () {
121 this.kdp = document.getElementById( this.pid );
125 function kdpDoOnPause( player ){
130 function onKdpReady( playerId ) {
131 js_log( "IN THEORY PLAYER IS READY:" + playerId);
133 window.myKdp=get(playerId);
134 get("Player_State").innerHTML="<br> READY (Id=" + playerId + ")";
135 get("nowPlaying").innerHTML=(myKdp.evaluate('{entryId}'));