Skip to content

Commit

Permalink
refactored custom php code to gear up for new resource loader and mor…
Browse files Browse the repository at this point in the history
…e strait forward configuration

git-svn-id: http://www.kaltura.org/kalorg/html5video/trunk/mwEmbed@1451 b58a29cf-3064-46da-94c6-1c29cc75c8e5
  • Loading branch information
KalturaGitBot committed Jan 4, 2011
1 parent 381f64f commit 6cb2dca
Show file tree
Hide file tree
Showing 8 changed files with 301 additions and 224 deletions.
9 changes: 9 additions & 0 deletions LocalSettings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
/**
* This file store all of mwEmbed local configuration ( in a default svn check out this file is empty )
*
* See includes/DefaultSettings.php for a configuration options
*/


?>
13 changes: 5 additions & 8 deletions ResourceLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
*/

//Setup the script local script cache directory
// ( has to be hard coded rather than config based for fast non-mediawiki config hits )
$wgScriptCacheDirectory = realpath( dirname( __FILE__ ) ) . '/includes/cache';

// Check if being used in mediaWiki ( ResourceLoader.php is NOT an entry point )
if( is_file ( dirname( __FILE__ ) .'../mwResourceLoader.php' )
Expand All @@ -16,10 +14,8 @@

// Check if we are an entry point or being used as part of MEDIAWIKI:
if ( !defined( 'MEDIAWIKI' ) && !defined( 'SCRIPTLOADER_MEDIAWIKI') ) {
// Allow an installation an optional PHP customization/overrides file
if ( is_file ( dirname( __FILE__ ) .'/../localSettings.php' ) ) {
require_once dirname( __FILE__ ) .'/../localSettings.php';
}
// Include settings ( will include LocalSettings.php in the root mwEmbed folder
require_once( dirname( __FILE__ ) . '/includes/DefaultSettings.php' );

// Load stand alone Resource Loader config
// ( if running as a remote, mediaWiki variables / functions are already included as part of mediaWiki )
Expand Down Expand Up @@ -1215,8 +1211,9 @@ public function getCacheFileName() {
$this->filename = "{$wgScriptCacheDirectory}/{$hash1}/{$hash2}/{$hash}.js";

// Check for defined files::
if( is_file( $this->filename ) )
return $this->filename;
if( is_file( $this->filename ) ){
return $this->filename;
}

// Check for non-config based gzip version already there?
if( is_file( $this->filename . '.gz') ){
Expand Down
52 changes: 52 additions & 0 deletions includes/DefaultSettings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php
/**
* This file stores default settings for Kaltura html5 client library "mwEmbed".
*
* DO NOT MODIFY THIS FILE. Instead modify LocalSettings.php in the parent mwEmbd directory.
*
*/

// The default cache directory
$wgScriptCacheDirectory = realpath( dirname( __FILE__ ) ) . '/cache';

// The absolute or relative path to mwEmbed install folder.
$wgMwEmbedPathUrl = false;

/*********************************************************
* Default Kaltura Configuration:
* TODO move kaltura configuration to KalturaSupport module ( part of ResourceLoader update )
********************************************************/

// The default Kaltura service url:
$wgKalturaServiceUrl = 'http://www.kaltura.com/';

// Default Kaltura CDN url:
$wgKalturaCDNUrl = 'http://cdn.kaltura.com';

// Default Kaltura service url:
$wgKalturaServiceBase = '/api_v3/index.php?';

// Default expire time for ui conf api queries in seconds
$wgKalturaUiConfCacheTime = 600;




/*********************************************************
* Include local settings override:
********************************************************/
$wgLocalSettingsFile = realpath( dirname( __FILE__ ) ) . '../LocalSettings.php';
if( is_file( $wgLocalSettingsFile ) ){
require_once( $wgLocalSettingsFile );
}

/*********************************************************
* Set any autoconfigure variables if not set in LocalSettings
*
* These variables should be set to false at the top of DefaultSettings.php
********************************************************/
if( $wgMwEmbedPathUrl === false ){
$wgMwEmbedPathUrl = str_replace( 'mwEmbedFrame.php', '', $_SERVER['SCRIPT_NAME'] );
}

?>
3 changes: 1 addition & 2 deletions modules/EmbedPlayer/mw.EmbedPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2068,8 +2068,7 @@ mw.EmbedPlayer.prototype = {
this.controls = true;
}
if( !this.useNativePlayerControls() && !this.isPersistentNativePlayer() && !_this.controlBuilder.checkOverlayControls() ){
// give the interface more space for the controls:
//this.$interface.css('height', this.height + _this.controlBuilder.height )
// Update the video size per available control space.
$j(this).css('height', this.height - _this.controlBuilder.height );
}

Expand Down
Loading

0 comments on commit 6cb2dca

Please sign in to comment.