Permalink
Browse files

Fixed the kaltura player to not show the play button over ad reels.

  • Loading branch information...
1 parent 106089d commit 3bad2dccc6d2363c9242d0af0e2090068659ce15 @travist committed Dec 19, 2013
@@ -140,10 +140,11 @@ minplayer.players.limelight.prototype.createPlayer=function(){minplayer.players.
"//assets.delvenetworks.com/player/loader.swf",id:d,width:this.options.width,height:"100%",flashvars:a,wmode:this.options.wmode})};minplayer.players.limelight.prototype.play=function(a){minplayer.players.flash.prototype.play.call(this,function(){this.player.doPlay();a&&a.call(this)})};minplayer.players.limelight.prototype.pause=function(a){minplayer.players.flash.prototype.pause.call(this,function(){this.player.doPause();a&&a.call(this)})};
minplayer.players.limelight.prototype.stop=function(a){minplayer.players.flash.prototype.stop.call(this,function(){this.player.doPause();a&&a.call(this)})};minplayer.players.limelight.prototype._seek=function(a){this.seekValue=a;this.player.doSeekToSecond(a)};minplayer.players.limelight.prototype.setVolume=function(a,b){minplayer.players.flash.prototype.setVolume.call(this,a,function(){this.player.doSetVolume(a);b&&b.call(this)})};minplayer.players.limelight.prototype._getVolume=function(a){a(this.player.doGetVolume())};
minplayer.players.limelight.prototype.search=function(a){this.whenReady(function(){this.player.doSearch(a)})};minplayer=minplayer||{};minplayer.players=minplayer.players||{};minplayer.players.kaltura=function(a,b){minplayer.players.base.call(this,a,b)};minplayer.players.kaltura.prototype=new minplayer.players.base;minplayer.players.kaltura.prototype.constructor=minplayer.players.kaltura;
-minplayer.players.kaltura.prototype.construct=function(){minplayer.players.base.prototype.construct.call(this);this.options.pluginName="kaltura"};minplayer.players.kaltura.prototype.defaultOptions=function(a){a.entryId=0;a.uiConfId=0;a.partnerId=0;minplayer.players.base.prototype.defaultOptions.call(this,a)};minplayer.players.kaltura.getPriority=function(){return 10};minplayer.players.kaltura.canPlay=function(a){return"video/kaltura"===a.mimetype?!0:0===a.path.search(/.*kaltura\.com.*/i)};
-minplayer.players.kaltura.prototype.playerStateChange=function(a){switch(a){case "ready":this.onLoaded();break;case "loading":case "buffering":this.onWaiting();break;case "playing":this.onPlaying();break;case "paused":this.onPaused()}};minplayer.players.kaltura.prototype.mediaReady=function(){this.onLoaded()};minplayer.players.kaltura.prototype.playerPlayEnd=function(a){this.onComplete()};minplayer.players.kaltura.prototype.playUpdate=function(a){this.currentTime.set(a)};
-minplayer.players.kaltura.prototype.durationChange=function(a){this.duration.set(a.newValue)};minplayer.players.kaltura.prototype.getInstance=function(){if(this.instanceName)return this.instanceName;var a=this.uuid.split("__"),b="minplayer.plugins."+a[0],b=b+("."+a[1]);return this.instanceName=b+="["+(a[2]-1)+"]"};
-minplayer.players.kaltura.prototype.registerEvents=function(){this.player.addJsListener("playerStateChange",this.getInstance()+".playerStateChange");this.player.addJsListener("durationChange",this.getInstance()+".durationChange");this.player.addJsListener("mediaReady",this.getInstance()+".mediaReady");this.player.addJsListener("playerUpdatePlayhead",this.getInstance()+".playUpdate");this.player.addJsListener("playerPlayEnd",this.getInstance()+".playerPlayEnd")};
+minplayer.players.kaltura.prototype.construct=function(){minplayer.players.base.prototype.construct.call(this);this.options.pluginName="kaltura";this.adPlaying=!1};minplayer.players.kaltura.prototype.defaultOptions=function(a){a.entryId=0;a.uiConfId=0;a.partnerId=0;minplayer.players.base.prototype.defaultOptions.call(this,a)};minplayer.players.kaltura.getPriority=function(){return 10};minplayer.players.kaltura.canPlay=function(a){return"video/kaltura"===a.mimetype?!0:0===a.path.search(/.*kaltura\.com.*/i)};
+minplayer.players.kaltura.prototype.adStart=function(a){this.adPlaying=!0;this.onPlaying()};minplayer.players.kaltura.prototype.adEnd=function(a){this.adPlaying=!1};minplayer.players.kaltura.prototype.playerStateChange=function(a){if(!this.adPlaying)switch(a){case "ready":this.onLoaded();break;case "loading":case "buffering":this.onWaiting();break;case "playing":this.onPlaying();break;case "paused":this.onPaused()}};minplayer.players.kaltura.prototype.mediaReady=function(){this.onLoaded()};
+minplayer.players.kaltura.prototype.playerPlayEnd=function(a){this.onComplete()};minplayer.players.kaltura.prototype.playUpdate=function(a){this.currentTime.set(a)};minplayer.players.kaltura.prototype.durationChange=function(a){this.duration.set(a.newValue)};minplayer.players.kaltura.prototype.getInstance=function(){if(this.instanceName)return this.instanceName;var a=this.uuid.split("__"),b="minplayer.plugins."+a[0],b=b+("."+a[1]);return this.instanceName=b+="["+(a[2]-1)+"]"};
+minplayer.players.kaltura.prototype.registerEvents=function(){this.player.addJsListener("adStart",this.getInstance()+".adStart");this.player.addJsListener("adEnd",this.getInstance()+".adEnd");this.player.addJsListener("playerStateChange",this.getInstance()+".playerStateChange");this.player.addJsListener("durationChange",this.getInstance()+".durationChange");this.player.addJsListener("mediaReady",this.getInstance()+".mediaReady");this.player.addJsListener("playerUpdatePlayhead",this.getInstance()+
+".playUpdate");this.player.addJsListener("playerPlayEnd",this.getInstance()+".playerPlayEnd")};
minplayer.players.kaltura.prototype.createPlayer=function(){minplayer.players.base.prototype.createPlayer.call(this);var a={},b=this;jQuery.each(["entryId","uiConfId","partnerId"],function(c,d){a[d]="";if(b.options[d])a[d]=b.options[d];else{var e=null;switch(d){case "entryId":e=/.*kaltura\.com.*entry_id\/([^\/]+)/i;break;case "uiConfId":e=/.*kaltura\.com.*uiconf_id\/([^\/]+)/i;break;case "partnerId":e=/.*kaltura\.com.*wid\/_([^\/]+)/i}e&&(a[d]=b.mediaFile.path.match(e),a[d]&&(a[d]=a[d][1]))}});var c=
document.createElement("script");c.src="http://cdnapi.kaltura.com/p/";c.src+=a.partnerId;c.src+="/sp/";c.src+=a.partnerId;c.src+="00/embedIframeJs/uiconf_id/";c.src+=a.uiConfId;c.src+="/partner_id/";c.src+=a.partnerId;var d=document.getElementsByTagName("script")[0];d.parentNode.insertBefore(c,d);var e=this.options.id+"-player";setTimeout(function g(){window.hasOwnProperty("kWidget")?kWidget.embed({targetId:e,wid:"_"+a.partnerId,uiconf_id:a.uiConfId,entry_id:a.entryId,flashvars:{autoPlay:!1},params:{wmode:"transparent"},
readyCallback:function(a){b.player=jQuery("#"+a).get(0);b.registerEvents();b.onReady()}}):setTimeout(g,1E3)},1E3);return'<div id="'+e+'" style="width:100%;height:100%;"></div>'};minplayer.players.kaltura.prototype.play=function(a){minplayer.players.base.prototype.play.call(this,function(){this.player.sendNotification("doPlay");a&&a.call(this)})};
View
@@ -5755,6 +5755,9 @@ minplayer.players.kaltura.prototype.construct = function() {
// Set the plugin name within the options.
this.options.pluginName = 'kaltura';
+
+ // Determine if an ad is playing.
+ this.adPlaying = false;
};
/**
@@ -5798,27 +5801,38 @@ minplayer.players.kaltura.canPlay = function(file) {
return (file.path.search(regex) === 0);
};
+minplayer.players.kaltura.prototype.adStart = function(data) {
+ this.adPlaying = true;
+ this.onPlaying();
+};
+
+minplayer.players.kaltura.prototype.adEnd = function(data) {
+ this.adPlaying = false;
+};
+
/**
* Keep track when the player state changes.
*
* @param {type} data
* @returns {undefined}
*/
minplayer.players.kaltura.prototype.playerStateChange = function(data) {
- switch (data) {
- case 'ready':
- this.onLoaded();
- break;
- case 'loading':
- case 'buffering':
- this.onWaiting();
- break;
- case 'playing':
- this.onPlaying();
- break;
- case 'paused':
- this.onPaused();
- break;
+ if (!this.adPlaying) {
+ switch (data) {
+ case 'ready':
+ this.onLoaded();
+ break;
+ case 'loading':
+ case 'buffering':
+ this.onWaiting();
+ break;
+ case 'playing':
+ this.onPlaying();
+ break;
+ case 'paused':
+ this.onPaused();
+ break;
+ }
}
};
@@ -5884,6 +5898,8 @@ minplayer.players.kaltura.prototype.getInstance = function() {
* @returns {undefined}
*/
minplayer.players.kaltura.prototype.registerEvents = function() {
+ this.player.addJsListener("adStart", this.getInstance() + '.adStart');
+ this.player.addJsListener("adEnd", this.getInstance() + '.adEnd');
this.player.addJsListener("playerStateChange", this.getInstance() + '.playerStateChange');
this.player.addJsListener("durationChange", this.getInstance() + '.durationChange');
this.player.addJsListener("mediaReady", this.getInstance() + '.mediaReady');
View
@@ -460,7 +460,7 @@ <h1 class="classTitle">File Index</h1>
</div>
<div class="fineprint" style="clear:both">
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Wed Dec 04 2013 21:55:07 GMT-0600 (CST)
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Wed Dec 18 2013 19:48:38 GMT-0600 (CST)
</div>
</body>
</html>
View
@@ -347,7 +347,7 @@ <h1 class="classTitle">Class Index</h1>
</div>
<div class="fineprint" style="clear:both">
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Wed Dec 04 2013 21:55:07 GMT-0600 (CST)
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Wed Dec 18 2013 19:48:38 GMT-0600 (CST)
</div>
</body>
</html>
@@ -447,7 +447,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 04 2013 21:55:06 GMT-0600 (CST)
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 18 2013 19:48:37 GMT-0600 (CST)
</div>
</body>
</html>
@@ -345,7 +345,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 04 2013 21:55:06 GMT-0600 (CST)
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 18 2013 19:48:37 GMT-0600 (CST)
</div>
</body>
</html>
@@ -529,7 +529,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 04 2013 21:55:06 GMT-0600 (CST)
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 18 2013 19:48:37 GMT-0600 (CST)
</div>
</body>
</html>
@@ -604,7 +604,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 04 2013 21:55:06 GMT-0600 (CST)
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 18 2013 19:48:37 GMT-0600 (CST)
</div>
</body>
</html>
@@ -1026,7 +1026,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 04 2013 21:55:07 GMT-0600 (CST)
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 18 2013 19:48:37 GMT-0600 (CST)
</div>
</body>
</html>
@@ -611,7 +611,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 04 2013 21:55:07 GMT-0600 (CST)
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 18 2013 19:48:37 GMT-0600 (CST)
</div>
</body>
</html>
@@ -550,7 +550,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 04 2013 21:55:07 GMT-0600 (CST)
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 18 2013 19:48:37 GMT-0600 (CST)
</div>
</body>
</html>
@@ -677,7 +677,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 04 2013 21:55:07 GMT-0600 (CST)
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 18 2013 19:48:38 GMT-0600 (CST)
</div>
</body>
</html>
@@ -2374,7 +2374,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 04 2013 21:55:07 GMT-0600 (CST)
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 18 2013 19:48:38 GMT-0600 (CST)
</div>
</body>
</html>
@@ -1385,7 +1385,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 04 2013 21:55:07 GMT-0600 (CST)
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 18 2013 19:48:38 GMT-0600 (CST)
</div>
</body>
</html>
@@ -697,7 +697,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 04 2013 21:55:07 GMT-0600 (CST)
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 18 2013 19:48:38 GMT-0600 (CST)
</div>
</body>
</html>
@@ -1146,7 +1146,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 04 2013 21:55:07 GMT-0600 (CST)
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 18 2013 19:48:38 GMT-0600 (CST)
</div>
</body>
</html>
@@ -325,6 +325,24 @@ <h1 class="classTitle">
<tbody>
<tr>
+ <td class="attributes">&nbsp;</td>
+ <td class="nameDescription">
+ <div class="fixedFont"><b><a href="../symbols/minplayer.players.kaltura.html#adEnd">adEnd</a></b>(data)
+ </div>
+ <div class="description"></div>
+ </td>
+ </tr>
+
+ <tr>
+ <td class="attributes">&nbsp;</td>
+ <td class="nameDescription">
+ <div class="fixedFont"><b><a href="../symbols/minplayer.players.kaltura.html#adStart">adStart</a></b>(data)
+ </div>
+ <div class="description"></div>
+ </td>
+ </tr>
+
+ <tr>
<td class="attributes">&lt;static&gt; &nbsp;</td>
<td class="nameDescription">
<div class="fixedFont">minplayer.players.kaltura.<b><a href="../symbols/minplayer.players.kaltura.html#.canPlay">canPlay</a></b>(file)
@@ -564,6 +582,78 @@ <h1 class="classTitle">
Method Detail
</div>
+ <a name="adEnd"> </a>
+ <div class="fixedFont">
+
+
+ <b>adEnd</b>(data)
+
+ </div>
+ <div class="description">
+
+
+
+ </div>
+
+
+
+
+ <dl class="detailList">
+ <dt class="heading">Parameters:</dt>
+
+ <dt>
+ <b>data</b>
+
+ </dt>
+ <dd></dd>
+
+ </dl>
+
+
+
+
+
+
+
+
+ <hr />
+
+ <a name="adStart"> </a>
+ <div class="fixedFont">
+
+
+ <b>adStart</b>(data)
+
+ </div>
+ <div class="description">
+
+
+
+ </div>
+
+
+
+
+ <dl class="detailList">
+ <dt class="heading">Parameters:</dt>
+
+ <dt>
+ <b>data</b>
+
+ </dt>
+ <dd></dd>
+
+ </dl>
+
+
+
+
+
+
+
+
+ <hr />
+
<a name=".canPlay"> </a>
<div class="fixedFont">&lt;static&gt;
@@ -1218,7 +1308,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 04 2013 21:55:07 GMT-0600 (CST)
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 18 2013 19:48:38 GMT-0600 (CST)
</div>
</body>
</html>
@@ -1026,7 +1026,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 04 2013 21:55:07 GMT-0600 (CST)
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 18 2013 19:48:38 GMT-0600 (CST)
</div>
</body>
</html>
@@ -904,7 +904,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 04 2013 21:55:07 GMT-0600 (CST)
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 18 2013 19:48:38 GMT-0600 (CST)
</div>
</body>
</html>
@@ -1381,7 +1381,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 04 2013 21:55:07 GMT-0600 (CST)
+ Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Dec 18 2013 19:48:38 GMT-0600 (CST)
</div>
</body>
</html>
Oops, something went wrong.

0 comments on commit 3bad2dc

Please sign in to comment.