Skip to content

Commit

Permalink
fixed iframe rewrite support
Browse files Browse the repository at this point in the history
git-svn-id: http://www.kaltura.org/kalorg/html5video/trunk/mwEmbed@1231 b58a29cf-3064-46da-94c6-1c29cc75c8e5
  • Loading branch information
KalturaGitBot committed Nov 26, 2010
1 parent f3aa26c commit f6c1a3f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 26 deletions.
7 changes: 1 addition & 6 deletions modules/KalturaSupport/kalturaIframe.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
<?php
/**
* kalturaIframe is a special stand alone page for iframe embed of mwEmbed modules
* kalturaIframe supp
*
* For now we just support the embedPlayer
*
* This enables sharing mwEmbed player without js includes ie:
*
* <iframe src="kalturaIframe.php?src={SRC URL}&poster={POSTER URL}&width={WIDTH}etc"> </iframe>
*/

// Some predefined constants ( need to load these from config..
Expand Down
3 changes: 2 additions & 1 deletion mwEmbedFrame.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
// ( need to refactor embedFrame into a more abstract class )
// @@TODO Need a php based configuration system for modules so they
// can extend / override entry points
if( isset( $myMwEmbedFrame->kwidgetid ) ){

if( isset( $myMwEmbedFrame->kwidgetid ) ){
require( dirname( __FILE__ ) . '/modules/KalturaSupport/kalturaIframe.php');
exit(1);
}
Expand Down
38 changes: 19 additions & 19 deletions mwEmbedLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
* // If the html5 library should be loaded when there are video tags in the page.
* 'Kaltura.LoadScriptForVideoTags' : true
*/
var kURID = '1.1y';
var kURID = '1.1z';
// Static script loader url:
var SCRIPT_LOADER_URL = 'http://www.kaltura.org/apis/html5lib/mwEmbed/ResourceLoader.php';
var SCRIPT_FORCE_DEBUG = false;
var FORCE_LOAD_JQUERY = false;

// These Lines are for local testing:
//SCRIPT_FORCE_DEBUG = true;
//SCRIPT_LOADER_URL = 'http://192.168.1.70/html5.kaltura/mwEmbed/ResourceLoader.php';
SCRIPT_FORCE_DEBUG = true;
SCRIPT_LOADER_URL = 'http://192.168.1.70/html5.kaltura/mwEmbed/ResourceLoader.php';
//kURID = new Date().getTime();

if( typeof console != 'undefined' && console.log ) {
Expand All @@ -48,7 +48,7 @@ if( !window['mw'] ){
window['mw'] = {};
}

// Magic url parameter to enable debug mode
// Url parameter to enable debug mode
if( document.URL.indexOf('debugKalturaPlayer=true') != -1 ){
SCRIPT_FORCE_DEBUG = true;
}
Expand Down Expand Up @@ -101,18 +101,18 @@ function kOverideSwfObject(){
mw.ready(function(){
// Setup the embedPlayer attributes
var embedPlayerAttributes = {
'kwidgetid' : kEmbedSettings.widgetid,
'kuiconfid' : kEmbedSettings.uiconfid
'kwidgetid' : kEmbedSettings.wid,
'kuiconfid' : kEmbedSettings.uiconf_id
}
var width = ( widthStr )? parseInt( widthStr ) : $j('#' + replaceTargetId ).width();
var height = ( heightStr)? parseInt( heightStr ) : $j('#' + replaceTargetId ).height();
if( kEmbedSettings.entryid ){
embedPlayerAttributes.kentryid = kEmbedSettings.entryid;
if( kEmbedSettings.entry_id ){
embedPlayerAttributes.kentryid = kEmbedSettings.entry_id;
embedPlayerAttributes.poster = kGetEntryThumbUrl( {
'width' : width,
'height' : height,
'entry_id' : kEmbedSettings.entryid,
'partner_id': kEmbedSettings.partnerId
'entry_id' : kEmbedSettings.entry_id,
'partner_id': kEmbedSettings.p
})
}
if( preMwEmbedConfig['Kaltura.IframeRewrite'] ){
Expand Down Expand Up @@ -154,7 +154,7 @@ function kOverideSwfObject(){
}
}
var kEmbedSettings = kGetKalturaEmbedSettings( _this.attributes.swf, flashVars);
if( kIsHTML5FallForward() && kEmbedSettings.uiconfid ){
if( kIsHTML5FallForward() && kEmbedSettings.uiconf_id ){
doEmbedSettingsWrite( kEmbedSettings, targetId, _this.attributes.width, _this.attributes.height);
} else {
// use the original flash player embed:
Expand All @@ -173,7 +173,7 @@ function kOverideSwfObject(){
kAddReadyHook(function(){
var kEmbedSettings = kGetKalturaEmbedSettings( swfUrlStr, flashvarsObj);
// Check if mobile safari:
if( kIsHTML5FallForward() && kEmbedSettings.widgetid ){
if( kIsHTML5FallForward() && kEmbedSettings.wid ){
doEmbedSettingsWrite( kEmbedSettings, replaceElemIdStr, widthStr, heightStr);
} else {
// Else call the original EmbedSWF with all its arguments
Expand Down Expand Up @@ -466,7 +466,7 @@ kGetKalturaPlayerList = function(){
var objectList = document.getElementsByTagName('object');
var tryAddKalturaEmbed = function( url ){
var settings = kGetKalturaEmbedSettings( url );
if( settings && settings.uiconfid && settings.widgetid ){
if( settings && settings.uiconf_id && settings.wid ){
kalturaPlayers.push( settings );
return true;
}
Expand Down Expand Up @@ -510,18 +510,18 @@ kGetKalturaEmbedSettings = function( swfUrl, flashvars ){
var curUrlPart = dataUrlParts.pop();
switch( curUrlPart ){
case 'p':
embedSettings.widgetid = '_' + prevUrlPart;
embedSettings.partnerId = prevUrlPart;
embedSettings.wid = '_' + prevUrlPart;
embedSettings.p = prevUrlPart;
break;
case 'wid':
embedSettings.widgetid = prevUrlPart;
embedSettings.partnerId = prevUrlPart.replace(/_/,'');
embedSettings.wid = prevUrlPart;
embedSettings.p = prevUrlPart.replace(/_/,'');
break;
case 'entry_id':
embedSettings.entryid = prevUrlPart;
embedSettings.entry_id = prevUrlPart;
break;
case 'uiconf_id':
embedSettings.uiconfid = prevUrlPart;
embedSettings.uiconf_id = prevUrlPart;
break;
case 'cache_st':
embedSettings.cacheSt = prevUrlPart;
Expand Down

0 comments on commit f6c1a3f

Please sign in to comment.