Skip to content

Commit

Permalink
support packing in iframe into mwEmbedLoader request
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Dale committed Oct 30, 2012
1 parent 8485ffe commit 9b8307b
Show file tree
Hide file tree
Showing 8 changed files with 934 additions and 896 deletions.
17 changes: 13 additions & 4 deletions kWidget/kWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ var kWidget = {

// flag for the already added css rule:
alreadyAddedThumbRules: false,

// For storing iframe payloads via server side include, instead of an additional request
// stored per player id
iframeAutoEmbedCache:{},
/**
* The master kWidget setup function setups up bindings for rewrites and
* proxy of jsCallbackReady
Expand Down Expand Up @@ -763,10 +767,15 @@ var kWidget = {
// Clear out this global function
window[ cbName ] = null;
};
// get iframe payload:
_this.appendScriptUrl( this.getIframeUrl() + '?' +
this.getIframeRequest( widgetElm, settings ) +
'&callback=' + cbName );
if( this.iframeAutoEmbedCache[ targetId ] ){
// get the playload from local cache
window[ cbName ]( this.iframeAutoEmbedCache[ targetId ] );
} else {
// do an iframe payload request:
_this.appendScriptUrl( this.getIframeUrl() + '?' +
this.getIframeRequest( widgetElm, settings ) +
'&callback=' + cbName );
}
},
getIframeCbName: function( iframeId ){
var _this = this;
Expand Down
5 changes: 3 additions & 2 deletions modules/KalturaSupport/KalturaResultObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ class KalturaResultObject {
'debug' => null,
// for thumbnails
'width' => null,
'height'=> null
'height'=> null,
'playerId' => null
);

var $playerConfig = array();
Expand Down Expand Up @@ -143,7 +144,7 @@ function getKalturaMsg( $msgKey ){
return $msgKey;
}

function formatString( $str ) {
static function formatString( $str ) {
// trim any whitespace
$str = trim( $str );
// decode the value:
Expand Down
Loading

0 comments on commit 9b8307b

Please sign in to comment.