Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/includes/MwEmbedWebStartSetup.php |
— | — | @@ -90,3 +90,15 @@ |
91 | 91 | # Create the wgRequest global: |
92 | 92 | $wgRequest = new WebRequest; |
93 | 93 | |
| 94 | +$wgLang = new UserLang(); |
| 95 | + |
| 96 | +# Register / load all the mwEmbed modules |
| 97 | +foreach( $wgMwEmbedEnabledModules as $moduleName ){ |
| 98 | + $modulePath = "modules/$moduleName"; |
| 99 | + if( is_file( "$IP/$modulePath/$moduleName.php" ) ){ |
| 100 | + MwEmbedResourceManager::register( $modulePath ); |
| 101 | + } |
| 102 | +} |
| 103 | +# Add the resource loader hook: |
| 104 | +$wgHooks['ResourceLoaderRegisterModules'][] = 'MwEmbedResourceManager::registerModules'; |
| 105 | + |
Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/includes/MwEmbedResourceLoader.php |
— | — | @@ -19,6 +19,7 @@ |
20 | 20 | $this->register( include( "$IP/resources/MwEmbedSharedResources.php" ) ); |
21 | 21 | // Register extension modules |
22 | 22 | wfRunHooks( 'ResourceLoaderRegisterModules', array( &$this ) ); |
| 23 | + |
23 | 24 | $this->register( $wgResourceModules ); |
24 | 25 | |
25 | 26 | wfProfileOut( __METHOD__ ); |
Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/includes/MwEmbedAutoLoader.php |
— | — | @@ -29,6 +29,7 @@ |
30 | 30 | 'MwEmbedResourceLoader' => 'includes/MwEmbedResourceLoader.php', |
31 | 31 | 'MwEmbedResourceLoaderFileModule' => 'includes/MwEmbedResourceLoaderFileModule.php', |
32 | 32 | 'MwEmbedResourceLoaderStartUpModule' => 'includes/MwEmbedResourceLoaderStartUpModule.php', |
| 33 | + 'MwEmbedResourceManager' => 'includes/MwEmbedResourceManager.php', |
33 | 34 | |
34 | 35 | ); |
35 | 36 | |
Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/includes/MwEmbedResourceManager.php |
— | — | @@ -0,0 +1,87 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * MwEmbedResourceManager adds some convenience functions for loading mwEmbed 'modules'. |
| 5 | + * Its shared between the mwEmbedStandAlone and the MwEmbed extension |
| 6 | + * |
| 7 | + * @file |
| 8 | + * @ingroup Extensions |
| 9 | + */ |
| 10 | + |
| 11 | +class MwEmbedResourceManager { |
| 12 | + |
| 13 | + protected static $moduleSet = array(); |
| 14 | + |
| 15 | + /** |
| 16 | + * Register mwEmbeed resource set |
| 17 | + * |
| 18 | + * Adds modules to ResourceLoader |
| 19 | + */ |
| 20 | + public static function register( $mwEmbedResourcePath ) { |
| 21 | + global $IP, $wgExtensionMessagesFiles; |
| 22 | + $fullResourcePath = $IP .'/'. $mwEmbedResourcePath; |
| 23 | + |
| 24 | + // Get the module name from the end of the path: |
| 25 | + $modulePathParts = explode( '/', $mwEmbedResourcePath ); |
| 26 | + $moduleName = array_pop ( $modulePathParts ); |
| 27 | + if( !is_dir( $fullResourcePath ) ){ |
| 28 | + throw new MWException( __METHOD__ . " not given readable path: " . htmlspecialchars( $mwEmbedResourcePath ) ); |
| 29 | + } |
| 30 | + |
| 31 | + if( substr( $mwEmbedResourcePath, -1 ) == '/' ){ |
| 32 | + throw new MWException( __METHOD__ . " path has trailing slash: " . htmlspecialchars( $mwEmbedResourcePath) ); |
| 33 | + } |
| 34 | + |
| 35 | + // Add the messages to the extension messages set: |
| 36 | + $wgExtensionMessagesFiles[ 'MwEmbed.' . $moduleName ] = $fullResourcePath . '/' . $moduleName . '.i18n.php'; |
| 37 | + |
| 38 | + // Get the mwEmbed module config |
| 39 | + $moduleInfo = require_once( $fullResourcePath . '/' . $moduleName . '.php' ); |
| 40 | + $resourceList = $moduleInfo['resources']; |
| 41 | + // Look for special 'messages' => 'moduleFile' key and load all modules file messages: |
| 42 | + foreach( $resourceList as $name => $resources ){ |
| 43 | + if( isset( $resources['messageFile'] ) && is_file( $fullResourcePath . '/' .$resources['messageFile'] ) ){ |
| 44 | + $resourceList[ $name ][ 'messages' ] = array(); |
| 45 | + include( $fullResourcePath . '/' .$resources['messageFile'] ); |
| 46 | + foreach( $messages['en'] as $msgKey => $na ){ |
| 47 | + $resourceList[ $name ][ 'messages' ][] = $msgKey; |
| 48 | + } |
| 49 | + } |
| 50 | + }; |
| 51 | + |
| 52 | + // If the module has a loader.js add it to the resource list: |
| 53 | + if( is_file( $fullResourcePath . '/loader.js' ) ){ |
| 54 | + $resourceList[$moduleName. '.loader'] = array( 'loaderScripts' => 'loader.js' ); |
| 55 | + } |
| 56 | + // @@TODO add $moduleInfo['config'] |
| 57 | + |
| 58 | + // Add the resource list into the module set with its provided path |
| 59 | + self::$moduleSet[ $mwEmbedResourcePath ] = $resourceList; |
| 60 | + } |
| 61 | + |
| 62 | + /** |
| 63 | + * ResourceLoaderRegisterModules hook |
| 64 | + * |
| 65 | + * Adds any mwEmbedResources to the ResourceLoader |
| 66 | + */ |
| 67 | + public static function registerModules( &$resourceLoader ) { |
| 68 | + global $IP; |
| 69 | + // Register all the resources with the resource loader |
| 70 | + foreach( self::$moduleSet as $path => $modules ) { |
| 71 | + foreach ( $modules as $name => $resources ) { |
| 72 | + $resourceLoader->register( |
| 73 | + // Resource loader expects trailing slash: |
| 74 | + $name, new MwEmbedResourceLoaderFileModule( $resources, "$IP/$path", $path) |
| 75 | + ); |
| 76 | + } |
| 77 | + } |
| 78 | + // Continue module processing |
| 79 | + return true; |
| 80 | + } |
| 81 | + |
| 82 | + // Add the mwEmbed module to the page: |
| 83 | + public static function addMwEmbedModule( &$out, &$sk ){ |
| 84 | + // Add the mwEmbed module to the output |
| 85 | + $out->addModules( 'mwEmbed' ); |
| 86 | + return true; |
| 87 | + } |
| 88 | +} |
\ No newline at end of file |
Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/includes/MwEmbedMediaWikiStubs.php |
— | — | @@ -16,7 +16,13 @@ |
17 | 17 | function wfDebug( $text, $logonly = false ) { |
18 | 18 | return ; |
19 | 19 | } |
20 | | - |
| 20 | +// Stub userLang ( if no language code provided |
| 21 | +class UserLang { |
| 22 | + // getCode (default english ) |
| 23 | + public function getCode(){ |
| 24 | + return 'en'; |
| 25 | + } |
| 26 | +} |
21 | 27 | // MWException stub: |
22 | 28 | class MWException extends Exception { |
23 | 29 | } |
Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/includes/MwEmbedResourceLoaderStartUpModule.php |
— | — | @@ -4,6 +4,32 @@ |
5 | 5 | // alone mode |
6 | 6 | |
7 | 7 | class MwEmbedResourceLoaderStartUpModule extends ResourceLoaderStartUpModule { |
| 8 | + /** |
| 9 | + * Get the files this module depends on indirectly for a given skin. |
| 10 | + * Currently these are only image files referenced by the module's CSS. |
| 11 | + * |
| 12 | + * @param $skin String: Skin name |
| 13 | + * @return Array: List of files |
| 14 | + */ |
| 15 | + public function getFileDependencies( $skin ) { |
| 16 | + // Try in-object cache first |
| 17 | + if ( isset( $this->fileDeps[$skin] ) ) { |
| 18 | + return $this->fileDeps[$skin]; |
| 19 | + } |
| 20 | + return array(); |
| 21 | + /*$dbr = wfGetDB( DB_SLAVE ); |
| 22 | + $deps = $dbr->selectField( 'module_deps', 'md_deps', array( |
| 23 | + 'md_module' => $this->getName(), |
| 24 | + 'md_skin' => $skin, |
| 25 | + ), __METHOD__ |
| 26 | + ); |
| 27 | + if ( !is_null( $deps ) ) { |
| 28 | + $this->fileDeps[$skin] = (array) FormatJson::decode( $deps, true ); |
| 29 | + } else { |
| 30 | + $this->fileDeps[$skin] = array(); |
| 31 | + } |
| 32 | + return $this->fileDeps[$skin];*/ |
| 33 | + } |
8 | 34 | |
9 | 35 | protected function getConfig( $context ) { |
10 | 36 | // @@todo set all the configuration variables |
Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/includes/resourceloader/ResourceLoader.php |
— | — | @@ -191,6 +191,7 @@ |
192 | 192 | * multiple-registration calling style. |
193 | 193 | * @throws MWException: If a duplicate module registration is attempted |
194 | 194 | * @throws MWException: If something other than a ResourceLoaderModule is being registered |
| 195 | + * @throws MWException: If an empty module name is being registered |
195 | 196 | * @return Boolean: False if there were any errors, in which case one or more modules were not |
196 | 197 | * registered |
197 | 198 | */ |
Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/includes/resourceloader/ResourceLoaderModule.php |
— | — | @@ -147,7 +147,6 @@ |
148 | 148 | * @return Array: List of files |
149 | 149 | */ |
150 | 150 | public function getFileDependencies( $skin ) { |
151 | | - print_r( debug_backtrace() ); |
152 | 151 | // Try in-object cache first |
153 | 152 | if ( isset( $this->fileDeps[$skin] ) ) { |
154 | 153 | return $this->fileDeps[$skin]; |
Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/includes/resourceloader/ResourceLoaderStartUpModule.php |
— | — | @@ -148,17 +148,21 @@ |
149 | 149 | global $IP, $wgLoadScript; |
150 | 150 | $out = file_get_contents( "$IP/resources/startup.js" ); |
151 | 151 | if ( $context->getOnly() === 'scripts' ) { |
| 152 | + // Get the latest version |
| 153 | + $version = 0; |
| 154 | + $modules = $this->getStartupModuleList(); |
| 155 | + foreach( $modules as $moduleName){ |
| 156 | + $version = max( $version, $context->getResourceLoader()->getModule( 'jquery' )->getModifiedTime( $context ) ); |
| 157 | + } |
| 158 | + |
152 | 159 | // Build load query for jquery and mediawiki modules |
153 | 160 | $query = array( |
154 | | - 'modules' => implode( '|', array( 'jquery', 'mediawiki' ) ), |
| 161 | + 'modules' => implode( '|', $modules ), |
155 | 162 | 'only' => 'scripts', |
156 | 163 | 'lang' => $context->getLanguage(), |
157 | 164 | 'skin' => $context->getSkin(), |
158 | 165 | 'debug' => $context->getDebug() ? 'true' : 'false', |
159 | | - 'version' => wfTimestamp( TS_ISO_8601_BASIC, round( max( |
160 | | - $context->getResourceLoader()->getModule( 'jquery' )->getModifiedTime( $context ), |
161 | | - $context->getResourceLoader()->getModule( 'mediawiki' )->getModifiedTime( $context ) |
162 | | - ), -2 ) ) |
| 166 | + 'version' => wfTimestamp( TS_ISO_8601_BASIC, round( $version, -2 ) ) |
163 | 167 | ); |
164 | 168 | // Ensure uniform query order |
165 | 169 | ksort( $query ); |
— | — | @@ -180,7 +184,9 @@ |
181 | 185 | } |
182 | 186 | return $out; |
183 | 187 | } |
184 | | - |
| 188 | + private function getStartupModuleList(){ |
| 189 | + return array( 'jquery', 'mediawiki' ); |
| 190 | + } |
185 | 191 | public function getModifiedTime( ResourceLoaderContext $context ) { |
186 | 192 | global $IP, $wgCacheEpoch; |
187 | 193 | |
Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/modules/EmbedPlayer/EmbedPlayer.php |
— | — | @@ -0,0 +1,287 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | + // Register all the EmbedPlayer modules in the $wgResourceModules global array |
| 5 | + return array( |
| 6 | + 'resources' => array( |
| 7 | + "mw.EmbedPlayer" => array( |
| 8 | + 'scripts' => array( "mw.EmbedPlayer.js", "skins/mw.PlayerControlBuilder.js" ), |
| 9 | + 'styles' => "skins/mw.style.EmbedPlayer.css", |
| 10 | + 'messageFile' => 'EmbedPlayer.i18n.php' |
| 11 | + ), |
| 12 | + |
| 13 | + "mw.EmbedPlayerKplayer" => array( 'scripts'=> "mw.EmbedPlayerKplayer.js" ), |
| 14 | + "mw.EmbedPlayerGeneric" => array( 'scripts'=> "mw.EmbedPlayerGeneric.js" ), |
| 15 | + "mw.EmbedPlayerJava" => array( 'scripts'=> "mw.EmbedPlayerJava.js"), |
| 16 | + "mw.EmbedPlayerNative" => array( 'scripts'=> "mw.EmbedPlayerNative.js" ), |
| 17 | + |
| 18 | + "mw.EmbedPlayerVlc" => array( 'scripts'=> "mw.EmbedPlayerVlc.js" ), |
| 19 | + |
| 20 | + "mw.IFramePlayerApiServer" => array( 'scripts' => "mw.IFramePlayerApiServer.js" ), |
| 21 | + "mw.IFramePlayerApiClient" => array( 'scripts' => "mw.IFramePlayerApiClient.js" ), |
| 22 | + |
| 23 | + "mw.PlayerSkinKskin" => array( 'scripts' => "skins/kskin/mw.PlayerSkinKskin.js", |
| 24 | + 'styles' => "skins/kskin/mw.style.PlayerSkinKskin.css"), |
| 25 | + |
| 26 | + "mw.PlayerSkinMvpcf" => array( 'scripts'=> "skins/mvpcf/mw.PlayerSkinMvpcf.js", |
| 27 | + 'styles'=> "skins/mvpcf/mw.style.PlayerSkinMvpcf.css"), |
| 28 | + ), |
| 29 | + // Set any default configuration |
| 30 | + 'config' => array( |
| 31 | + // If the player controls should be overlaid on top of the video ( if supported by playback method) |
| 32 | + // can be set to false per embed player via overlayControls attribute |
| 33 | + 'EmbedPlayer.OverlayControls' => true, |
| 34 | + |
| 35 | + // If the iPad should use html controls ( can't use fullscreen or control volume, |
| 36 | + // but lets you support overlays ie html controls ads etc. ) |
| 37 | + 'EmbedPlayer.EnableIpadHTMLControls'=> false, |
| 38 | + |
| 39 | + 'EmbedPlayer.LibraryPage'=> 'http://www.kaltura.org/project/HTML5_Video_Media_JavaScript_Library', |
| 40 | + |
| 41 | + // A default apiProvider ( ie where to lookup subtitles, video properties etc ) |
| 42 | + // NOTE: Each player instance can also specify a specific provider |
| 43 | + "EmbedPlayer.ApiProvider" => "local", |
| 44 | + |
| 45 | + // What tags will be re-written to video player by default |
| 46 | + // Set to empty string or null to avoid automatic video tag rewrites to embedPlayer |
| 47 | + "EmbedPlayer.RewriteTags" => "video,audio,playlist", |
| 48 | + |
| 49 | + // Default video size ( if no size provided ) |
| 50 | + "EmbedPlayer.DefaultSize" => "400x300", |
| 51 | + |
| 52 | + // If the video player should attribute kaltura |
| 53 | + "EmbedPlayer.KalturaAttribution" => true, |
| 54 | + |
| 55 | + // The attribution button |
| 56 | + 'EmbedPlayer.AttributionButton' => array( |
| 57 | + 'title' => 'Kaltura html5 video library', |
| 58 | + 'href' => 'http://www.kaltura.org/project/HTML5_Video_Media_JavaScript_Library', |
| 59 | + // Style icon to be applied |
| 60 | + 'class' => 'kaltura-icon', |
| 61 | + // An icon image url ( should be a 12x12 image or data url ) |
| 62 | + 'iconurl' => false |
| 63 | + ), |
| 64 | + |
| 65 | + // If the player should wait for metadata like video size and duration, before trying to draw |
| 66 | + // the player interface. |
| 67 | + 'EmbedPlayer.WaitForMeta' => true, |
| 68 | + |
| 69 | + // Set the browser player warning flag displays warning for non optimal playback |
| 70 | + "EmbedPlayer.ShowNativeWarning" => true, |
| 71 | + |
| 72 | + // If fullscreen is global enabled. |
| 73 | + "EmbedPlayer.EnableFullscreen" => true, |
| 74 | + |
| 75 | + // If mwEmbed should use the Native player controls |
| 76 | + // this will prevent video tag rewriting and skinning |
| 77 | + // useful for devices such as iPad / iPod that |
| 78 | + // don't fully support DOM overlays or don't expose full-screen |
| 79 | + // functionality to javascript |
| 80 | + "EmbedPlayer.NativeControls" => false, |
| 81 | + |
| 82 | + // If mwEmbed should use native controls on mobile safari |
| 83 | + "EmbedPlayer.NativeControlsMobileSafari" => true, |
| 84 | + |
| 85 | + |
| 86 | + // The z-index given to the player interface during full screen ( high z-index ) |
| 87 | + "EmbedPlayer.fullScreenZIndex" => 999998, |
| 88 | + |
| 89 | + // The default share embed mode ( can be "object" or "videojs" ) |
| 90 | + // |
| 91 | + // "iframe" will provide a <iframe tag pointing to mwEmbedFrame.php |
| 92 | + // Object embedding should be much more compatible with sites that |
| 93 | + // let users embed flash applets |
| 94 | + // "videojs" will include the source javascript and video tag to |
| 95 | + // rewrite the player on the remote page DOM |
| 96 | + // Video tag embedding is much more mash-up friendly but exposes |
| 97 | + // the remote site to the mwEmbed javascript and can be a xss issue. |
| 98 | + "EmbedPlayer.ShareEmbedMode" => 'iframe', |
| 99 | + |
| 100 | + // Default player skin name |
| 101 | + "EmbedPlayer.SkinName" => "mvpcf", |
| 102 | + |
| 103 | + // Number of milliseconds between interface updates |
| 104 | + 'EmbedPlayer.MonitorRate' => 250, |
| 105 | + |
| 106 | + // If the embedPlayer should accept arguments passed in from iframe postMessages calls |
| 107 | + 'EmbedPlayer.EnalbeIFramePlayerServer' => false, |
| 108 | + |
| 109 | + // If embedPlayer should support server side temporal urls for seeking options are |
| 110 | + // flash|always|none default is support for flash only. |
| 111 | + 'EmbedPlayer.EnableURLTimeEncoding' => 'flash', |
| 112 | + |
| 113 | + // The domains which can read and send events to the video player |
| 114 | + 'EmbedPLayer.IFramePlayer.DomainWhiteList' => '*', |
| 115 | + |
| 116 | + // If the iframe should send and receive javascript events across domains via postMessage |
| 117 | + 'EmbedPlayer.EnableIframeApi' => true, |
| 118 | + |
| 119 | + /** |
| 120 | + * The base source attribute checks also see: |
| 121 | + * http://dev.w3.org/html5/spec/Overview.html#the-source-element |
| 122 | + */ |
| 123 | + 'EmbedPlayer.SourceAttributes' => array( |
| 124 | + // source id |
| 125 | + 'id', |
| 126 | + |
| 127 | + // media url |
| 128 | + 'src', |
| 129 | + |
| 130 | + // Title string for the source asset |
| 131 | + 'title', |
| 132 | + |
| 133 | + // boolean if we support temporal url requests on the source media |
| 134 | + 'URLTimeEncoding', |
| 135 | + |
| 136 | + // Media has a startOffset ( used for plugins that |
| 137 | + // display ogg page time rather than presentation time |
| 138 | + 'startOffset', |
| 139 | + |
| 140 | + // A hint to the duration of the media file so that duration |
| 141 | + // can be displayed in the player without loading the media file |
| 142 | + 'durationHint', |
| 143 | + |
| 144 | + // Media start time |
| 145 | + 'start', |
| 146 | + |
| 147 | + // Media end time |
| 148 | + 'end', |
| 149 | + |
| 150 | + // If the source is the default source |
| 151 | + 'default', |
| 152 | + |
| 153 | + // Title of the source |
| 154 | + 'title', |
| 155 | + |
| 156 | + // titleKey ( used for api lookups TODO move into mediaWiki specific support |
| 157 | + 'titleKey' |
| 158 | + ), |
| 159 | + /** |
| 160 | + * Merge in the default video attributes supported by embedPlayer: |
| 161 | + */ |
| 162 | + 'EmbedPlayer.Attributes' => array( |
| 163 | + /* |
| 164 | + * Base html element attributes: |
| 165 | + */ |
| 166 | + |
| 167 | + // id: Auto-populated if unset |
| 168 | + "id" => null, |
| 169 | + |
| 170 | + // Width: alternate to "style" to set player width |
| 171 | + "width" => null, |
| 172 | + |
| 173 | + // Height: alternative to "style" to set player height |
| 174 | + "height" => null, |
| 175 | + |
| 176 | + /* |
| 177 | + * Base html5 video element attributes / states also see: |
| 178 | + * http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html |
| 179 | + */ |
| 180 | + |
| 181 | + // Media src URI, can be relative or absolute URI |
| 182 | + "src" => null, |
| 183 | + |
| 184 | + // Poster attribute for displaying a place holder image before loading |
| 185 | + // or playing the video |
| 186 | + "poster" => null, |
| 187 | + |
| 188 | + // Autoplay if the media should start playing |
| 189 | + "autoplay" => false, |
| 190 | + |
| 191 | + // Loop attribute if the media should repeat on complete |
| 192 | + "loop" => false, |
| 193 | + |
| 194 | + // If the player controls should be displayed |
| 195 | + "controls" => true, |
| 196 | + |
| 197 | + // Video starts "paused" |
| 198 | + "paused" => true, |
| 199 | + |
| 200 | + // ReadyState an attribute informs clients of video loading state: |
| 201 | + // see: http://www.whatwg.org/specs/web-apps/current-work/#readystate |
| 202 | + "readyState" => 0, |
| 203 | + |
| 204 | + // Loading state of the video element |
| 205 | + "networkState" => 0, |
| 206 | + |
| 207 | + // Current playback position |
| 208 | + "currentTime" => 0, |
| 209 | + |
| 210 | + // Previous player set time |
| 211 | + // Lets javascript use $j('#videoId').get(0).currentTime = newTime; |
| 212 | + "previousTime" => 0, |
| 213 | + |
| 214 | + // Previous player set volume |
| 215 | + // Lets javascript use $j('#videoId').get(0).volume = newVolume; |
| 216 | + "previousVolume" => 1, |
| 217 | + |
| 218 | + // Initial player volume: |
| 219 | + "volume" => 0.75, |
| 220 | + |
| 221 | + // Caches the volume before a mute toggle |
| 222 | + "preMuteVolume" => 0.75, |
| 223 | + |
| 224 | + // Media duration: Value is populated via |
| 225 | + // custom durationHint attribute or via the media file once its played |
| 226 | + "duration" => null, |
| 227 | + |
| 228 | + // Mute state |
| 229 | + "muted" => false, |
| 230 | + |
| 231 | + /** |
| 232 | + * Custom attributes for embedPlayer player: (not part of the html5 |
| 233 | + * video spec) |
| 234 | + */ |
| 235 | + |
| 236 | + // Default video aspect ratio |
| 237 | + 'videoAspect' => '4:3', |
| 238 | + |
| 239 | + // Start time of the clip |
| 240 | + "start" => 0, |
| 241 | + |
| 242 | + // End time of the clip |
| 243 | + "end" => null, |
| 244 | + |
| 245 | + // A apiTitleKey for looking up subtitles, credits and related videos |
| 246 | + // TODO move to data-mwTitleKey and into mediaWikiSupport module |
| 247 | + "apiTitleKey" => null, |
| 248 | + |
| 249 | + // The apiProvider where to lookup the title key |
| 250 | + // TODO move to data-mwApiProvider and into mediaWikiSupport module |
| 251 | + "apiProvider" => null, |
| 252 | + |
| 253 | + // If the player controls should be overlaid |
| 254 | + // ( Global default via config EmbedPlayer.OverlayControls in module |
| 255 | + // loader.js) |
| 256 | + "overlaycontrols" => true, |
| 257 | + |
| 258 | + // Attribute to use 'native' controls |
| 259 | + "usenativecontrols" => false, |
| 260 | + |
| 261 | + // If the player should include an attribution button: |
| 262 | + 'attributionbutton' => true, |
| 263 | + |
| 264 | + // ROE url ( for xml based metadata ) |
| 265 | + // also see: http://wiki.xiph.org/ROE |
| 266 | + "roe" => null, |
| 267 | + |
| 268 | + // If serving an ogg_chop segment use this to offset the presentation |
| 269 | + // time |
| 270 | + // ( for some plugins that use ogg page time rather than presentation |
| 271 | + // time ) |
| 272 | + "startOffset" => 0, |
| 273 | + |
| 274 | + // Source page for media asset ( used for linkbacks in remote embedding |
| 275 | + // ) |
| 276 | + "linkback" => null, |
| 277 | + |
| 278 | + // If the download link should be shown |
| 279 | + "download_link" => true, |
| 280 | + |
| 281 | + // Content type of the media |
| 282 | + "type" => null |
| 283 | + ), |
| 284 | + ), |
| 285 | + ); |
| 286 | + |
| 287 | + |
| 288 | +?> |
\ No newline at end of file |
Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/modules/EmbedPlayer/loader.js |
— | — | @@ -4,299 +4,13 @@ |
5 | 5 | /** |
6 | 6 | * Default player module configuration |
7 | 7 | */ |
8 | | -( function( mw ) { |
9 | | - |
10 | | - mw.setDefaultConfig( { |
11 | | - // If the player controls should be overlaid on top of the video ( if supported by playback method) |
12 | | - // can be set to false per embed player via overlayControls attribute |
13 | | - 'EmbedPlayer.OverlayControls' : true, |
14 | | - |
15 | | - // If the iPad should use html controls ( can't use fullscreen or control volume, |
16 | | - // but lets you support overlays ie html controls ads etc. ) |
17 | | - 'EmbedPlayer.EnableIpadHTMLControls': false, |
18 | | - |
19 | | - 'EmbedPlayer.LibraryPage': 'http://www.kaltura.org/project/HTML5_Video_Media_JavaScript_Library', |
20 | | - |
21 | | - // A default apiProvider ( ie where to lookup subtitles, video properties etc ) |
22 | | - // NOTE: Each player instance can also specify a specific provider |
23 | | - "EmbedPlayer.ApiProvider" : "local", |
24 | | - |
25 | | - // What tags will be re-written to video player by default |
26 | | - // Set to empty string or null to avoid automatic video tag rewrites to embedPlayer |
27 | | - "EmbedPlayer.RewriteTags" : "video,audio,playlist", |
28 | | - |
29 | | - // Default video size ( if no size provided ) |
30 | | - "EmbedPlayer.DefaultSize" : "400x300", |
31 | | - |
32 | | - // If the video player should attribute kaltura |
33 | | - "EmbedPlayer.KalturaAttribution" : true, |
34 | | - |
35 | | - // The attribution button |
36 | | - 'EmbedPlayer.AttributionButton' :{ |
37 | | - 'title' : 'Kaltura html5 video library', |
38 | | - 'href' : 'http://www.kaltura.org/project/HTML5_Video_Media_JavaScript_Library', |
39 | | - // Style icon to be applied |
40 | | - 'class' : 'kaltura-icon', |
41 | | - // An icon image url ( should be a 12x12 image or data url ) |
42 | | - 'iconurl' : false |
43 | | - }, |
44 | | - |
45 | | - // If the player should wait for metadata like video size and duration, before trying to draw |
46 | | - // the player interface. |
47 | | - 'EmbedPlayer.WaitForMeta' : true, |
48 | | - |
49 | | - // Set the browser player warning flag displays warning for non optimal playback |
50 | | - "EmbedPlayer.ShowNativeWarning" : true, |
51 | | - |
52 | | - // If fullscreen is global enabled. |
53 | | - "EmbedPlayer.EnableFullscreen" : true, |
54 | | - |
55 | | - // If mwEmbed should use the Native player controls |
56 | | - // this will prevent video tag rewriting and skinning |
57 | | - // useful for devices such as iPad / iPod that |
58 | | - // don't fully support DOM overlays or don't expose full-screen |
59 | | - // functionality to javascript |
60 | | - "EmbedPlayer.NativeControls" : false, |
61 | | - |
62 | | - // If mwEmbed should use native controls on mobile safari |
63 | | - "EmbedPlayer.NativeControlsMobileSafari" : true, |
64 | | - |
65 | | - |
66 | | - // The z-index given to the player interface during full screen ( high z-index ) |
67 | | - "EmbedPlayer.fullScreenZIndex" : 999998, |
68 | | - |
69 | | - // The default share embed mode ( can be "object" or "videojs" ) |
70 | | - // |
71 | | - // "iframe" will provide a <iframe tag pointing to mwEmbedFrame.php |
72 | | - // Object embedding should be much more compatible with sites that |
73 | | - // let users embed flash applets |
74 | | - // "videojs" will include the source javascript and video tag to |
75 | | - // rewrite the player on the remote page DOM |
76 | | - // Video tag embedding is much more mash-up friendly but exposes |
77 | | - // the remote site to the mwEmbed javascript and can be a xss issue. |
78 | | - "EmbedPlayer.ShareEmbedMode" : 'iframe', |
79 | | - |
80 | | - // Default player skin name |
81 | | - "EmbedPlayer.SkinName" : "mvpcf", |
82 | | - |
83 | | - // Number of milliseconds between interface updates |
84 | | - 'EmbedPlayer.MonitorRate' : 250, |
85 | | - |
86 | | - // If the embedPlayer should accept arguments passed in from iframe postMessages calls |
87 | | - 'EmbedPlayer.EnalbeIFramePlayerServer' : false, |
88 | | - |
89 | | - // If embedPlayer should support server side temporal urls for seeking options are |
90 | | - // flash|always|none default is support for flash only. |
91 | | - 'EmbedPlayer.EnableURLTimeEncoding' : 'flash', |
92 | | - |
93 | | - // The domains which can read and send events to the video player |
94 | | - 'EmbedPLayer.IFramePlayer.DomainWhiteList' : '*', |
95 | | - |
96 | | - // If the iframe should send and receive javascript events across domains via postMessage |
97 | | - 'EmbedPlayer.EnableIframeApi' : true |
98 | | - } ); |
99 | | - |
| 8 | +( function( mw, $ ) { |
100 | 9 | /** |
101 | | - * The base source attribute checks also see: |
102 | | - * http://dev.w3.org/html5/spec/Overview.html#the-source-element |
103 | | - */ |
104 | | - mw.setDefaultConfig( 'EmbedPlayer.SourceAttributes', [ |
105 | | - // source id |
106 | | - 'id', |
107 | | - |
108 | | - // media url |
109 | | - 'src', |
110 | | - |
111 | | - // Title string for the source asset |
112 | | - 'title', |
113 | | - |
114 | | - // boolean if we support temporal url requests on the source media |
115 | | - 'URLTimeEncoding', |
116 | | - |
117 | | - // Media has a startOffset ( used for plugins that |
118 | | - // display ogg page time rather than presentation time |
119 | | - 'startOffset', |
120 | | - |
121 | | - // A hint to the duration of the media file so that duration |
122 | | - // can be displayed in the player without loading the media file |
123 | | - 'durationHint', |
124 | | - |
125 | | - // Media start time |
126 | | - 'start', |
127 | | - |
128 | | - // Media end time |
129 | | - 'end', |
130 | | - |
131 | | - // If the source is the default source |
132 | | - 'default', |
133 | | - |
134 | | - // Title of the source |
135 | | - 'title', |
136 | | - |
137 | | - // titleKey ( used for api lookups TODO move into mediaWiki specific support |
138 | | - 'titleKey' |
139 | | - ] ); |
140 | | - |
141 | | - /** |
142 | | - * Merge in the default video attributes supported by embedPlayer: |
143 | | - */ |
144 | | - mw.mergeConfig('EmbedPlayer.Attributes', { |
145 | | - /* |
146 | | - * Base html element attributes: |
147 | | - */ |
148 | | - |
149 | | - // id: Auto-populated if unset |
150 | | - "id" : null, |
151 | | - |
152 | | - // Width: alternate to "style" to set player width |
153 | | - "width" : null, |
154 | | - |
155 | | - // Height: alternative to "style" to set player height |
156 | | - "height" : null, |
157 | | - |
158 | | - /* |
159 | | - * Base html5 video element attributes / states also see: |
160 | | - * http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html |
161 | | - */ |
162 | | - |
163 | | - // Media src URI, can be relative or absolute URI |
164 | | - "src" : null, |
165 | | - |
166 | | - // Poster attribute for displaying a place holder image before loading |
167 | | - // or playing the video |
168 | | - "poster" : null, |
169 | | - |
170 | | - // Autoplay if the media should start playing |
171 | | - "autoplay" : false, |
172 | | - |
173 | | - // Loop attribute if the media should repeat on complete |
174 | | - "loop" : false, |
175 | | - |
176 | | - // If the player controls should be displayed |
177 | | - "controls" : true, |
178 | | - |
179 | | - // Video starts "paused" |
180 | | - "paused" : true, |
181 | | - |
182 | | - // ReadyState an attribute informs clients of video loading state: |
183 | | - // see: http://www.whatwg.org/specs/web-apps/current-work/#readystate |
184 | | - "readyState" : 0, |
185 | | - |
186 | | - // Loading state of the video element |
187 | | - "networkState" : 0, |
188 | | - |
189 | | - // Current playback position |
190 | | - "currentTime" : 0, |
191 | | - |
192 | | - // Previous player set time |
193 | | - // Lets javascript use $j('#videoId').get(0).currentTime = newTime; |
194 | | - "previousTime" : 0, |
195 | | - |
196 | | - // Previous player set volume |
197 | | - // Lets javascript use $j('#videoId').get(0).volume = newVolume; |
198 | | - "previousVolume" : 1, |
199 | | - |
200 | | - // Initial player volume: |
201 | | - "volume" : 0.75, |
202 | | - |
203 | | - // Caches the volume before a mute toggle |
204 | | - "preMuteVolume" : 0.75, |
205 | | - |
206 | | - // Media duration: Value is populated via |
207 | | - // custom durationHint attribute or via the media file once its played |
208 | | - "duration" : null, |
209 | | - |
210 | | - // Mute state |
211 | | - "muted" : false, |
212 | | - |
213 | | - /** |
214 | | - * Custom attributes for embedPlayer player: (not part of the html5 |
215 | | - * video spec) |
216 | | - */ |
217 | | - |
218 | | - // Default video aspect ratio |
219 | | - 'videoAspect' : '4:3', |
220 | | - |
221 | | - // Start time of the clip |
222 | | - "start" : 0, |
223 | | - |
224 | | - // End time of the clip |
225 | | - "end" : null, |
226 | | - |
227 | | - // A apiTitleKey for looking up subtitles, credits and related videos |
228 | | - "apiTitleKey" : null, |
229 | | - |
230 | | - // The apiProvider where to lookup the title key |
231 | | - "apiProvider" : null, |
232 | | - |
233 | | - // If the player controls should be overlaid |
234 | | - // ( Global default via config EmbedPlayer.OverlayControls in module |
235 | | - // loader.js) |
236 | | - "overlaycontrols" : true, |
237 | | - |
238 | | - // Attribute to use 'native' controls |
239 | | - "usenativecontrols" : false, |
240 | | - |
241 | | - // If the player should include an attribution button: |
242 | | - 'attributionbutton' : true, |
243 | | - |
244 | | - // ROE url ( for xml based metadata ) |
245 | | - // also see: http://wiki.xiph.org/ROE |
246 | | - "roe" : null, |
247 | | - |
248 | | - // If serving an ogg_chop segment use this to offset the presentation |
249 | | - // time |
250 | | - // ( for some plugins that use ogg page time rather than presentation |
251 | | - // time ) |
252 | | - "startOffset" : 0, |
253 | | - |
254 | | - // Thumbnail (same as poster) |
255 | | - "thumbnail" : null, |
256 | | - |
257 | | - // Source page for media asset ( used for linkbacks in remote embedding |
258 | | - // ) |
259 | | - "linkback" : null, |
260 | | - |
261 | | - // If the download link should be shown |
262 | | - "download_link" : true, |
263 | | - |
264 | | - // Content type of the media |
265 | | - "type" : null |
266 | | - } ); |
267 | | - |
268 | | - // Add class file paths |
269 | | - mw.addResourcePaths( { |
270 | | - "mw.EmbedPlayer" : "mw.EmbedPlayer.js", |
271 | | - |
272 | | - "mw.EmbedPlayerKplayer" : "mw.EmbedPlayerKplayer.js", |
273 | | - "mw.EmbedPlayerGeneric" : "mw.EmbedPlayerGeneric.js", |
274 | | - "mw.EmbedPlayerHtml" : "mw.EmbedPlayerHtml.js", |
275 | | - "mw.EmbedPlayerJava": "mw.EmbedPlayerJava.js", |
276 | | - "mw.EmbedPlayerNative" : "mw.EmbedPlayerNative.js", |
277 | | - |
278 | | - "mw.EmbedPlayerVlc" : "mw.EmbedPlayerVlc.js", |
279 | | - |
280 | | - "mw.PlayerControlBuilder" : "skins/mw.PlayerControlBuilder.js", |
281 | | - |
282 | | - "mw.style.EmbedPlayer" : "skins/mw.style.EmbedPlayer.css", |
283 | | - |
284 | | - "mw.style.PlayerSkinKskin" : "skins/kskin/mw.style.PlayerSkinKskin.css", |
285 | | - |
286 | | - "mw.PlayerSkinKskin" : "skins/kskin/mw.PlayerSkinKskin.js", |
287 | | - |
288 | | - "mw.PlayerSkinMvpcf" : "skins/mvpcf/mw.PlayerSkinMvpcf.js", |
289 | | - "mw.style.PlayerSkinMvpcf" : "skins/mvpcf/mw.style.PlayerSkinMvpcf.css", |
290 | | - |
291 | | - "mw.IFramePlayerApiServer" : "mw.IFramePlayerApiServer.js", |
292 | | - "mw.IFramePlayerApiClient" : "mw.IFramePlayerApiClient.js" |
293 | | - } ); |
294 | | - |
295 | | - /** |
296 | 10 | * Check the current DOM for any tags in "EmbedPlayer.RewriteTags" |
297 | 11 | */ |
298 | 12 | mw.documentHasPlayerTags = function() { |
299 | 13 | var rewriteTags = mw.getConfig( 'EmbedPlayer.RewriteTags' ); |
300 | | - if( $j( rewriteTags ).length != 0 ) { |
| 14 | + if( $( rewriteTags ).length != 0 ) { |
301 | 15 | return true; |
302 | 16 | } |
303 | 17 | return false; |
— | — | @@ -308,44 +22,41 @@ |
309 | 23 | * We use mw.addSetupHook instead of mw.ready so that |
310 | 24 | * mwEmbed player is setup before any other mw.ready calls |
311 | 25 | */ |
312 | | - mw.addSetupHook( function( callback ) { |
313 | | - mw.rewritePagePlayerTags( callback ); |
314 | | - }); |
315 | | - |
316 | | - mw.rewritePagePlayerTags = function( callback ) { |
| 26 | + $( mw ).bind( 'SetupInterface', function( event, callback ){ |
| 27 | + |
317 | 28 | mw.log( 'Loader::EmbedPlayer:rewritePagePlayerTags:' + mw.documentHasPlayerTags() ); |
318 | 29 | |
319 | 30 | // Allow modules to do tag rewrites as well: |
320 | 31 | var doModuleTagRewrites = function(){ |
321 | | - $j(mw).triggerQueueCallback( 'LoadeRewritePlayerTags', callback ); |
322 | | - } |
| 32 | + $(mw).triggerQueueCallback( 'LoadeRewritePlayerTags', callback ); |
| 33 | + } |
323 | 34 | |
324 | 35 | if( mw.documentHasPlayerTags() ) { |
325 | 36 | var rewriteElementCount = 0; |
326 | 37 | |
327 | 38 | // Set each player to loading ( as early on as possible ) |
328 | | - $j( mw.getConfig( 'EmbedPlayer.RewriteTags' ) ).each( function( index, element ){ |
| 39 | + $( mw.getConfig( 'EmbedPlayer.RewriteTags' ) ).each( function( index, element ){ |
329 | 40 | |
330 | 41 | // Assign an the element an ID ( if its missing one ) |
331 | | - if ( $j( element ).attr( "id" ) == '' ) { |
332 | | - $j( element ).attr( "id", 'v' + ( rewriteElementCount++ ) ); |
| 42 | + if ( $( element ).attr( "id" ) == '' ) { |
| 43 | + $( element ).attr( "id", 'v' + ( rewriteElementCount++ ) ); |
333 | 44 | } |
334 | 45 | // Add an absolute positioned loader |
335 | | - $j( element ) |
| 46 | + $( element ) |
336 | 47 | .getAbsoluteOverlaySpinner() |
337 | | - .attr('id', 'loadingSpinner_' + $j( element ).attr('id') ) |
| 48 | + .attr('id', 'loadingSpinner_' + $( element ).attr('id') ) |
338 | 49 | .addClass( 'playerLoadingSpinner' ); |
339 | 50 | |
340 | 51 | }); |
341 | 52 | // Load the embedPlayer module ( then run queued hooks ) |
342 | 53 | mw.load( 'EmbedPlayer', function ( ) { |
343 | 54 | // Rewrite the EmbedPlayer.RewriteTags with the |
344 | | - $j( mw.getConfig( 'EmbedPlayer.RewriteTags' ) ).embedPlayer( doModuleTagRewrites ); |
| 55 | + $( mw.getConfig( 'EmbedPlayer.RewriteTags' ) ).embedPlayer( doModuleTagRewrites ); |
345 | 56 | }) |
346 | 57 | } else { |
347 | 58 | doModuleTagRewrites(); |
348 | 59 | } |
349 | | - }; |
| 60 | + }); |
350 | 61 | |
351 | 62 | /** |
352 | 63 | * Add the module loader function: |
— | — | @@ -353,7 +64,7 @@ |
354 | 65 | mw.addModuleLoader( 'EmbedPlayer', function() { |
355 | 66 | var _this = this; |
356 | 67 | // Hide videonojs class |
357 | | - $j( '.videonojs' ).hide(); |
| 68 | + $( '.videonojs' ).hide(); |
358 | 69 | |
359 | 70 | // Set up the embed video player class request: (include the skin js as well) |
360 | 71 | var dependencyRequest = [ |
— | — | @@ -362,40 +73,40 @@ |
363 | 74 | ], |
364 | 75 | [ |
365 | 76 | 'mw.PlayerControlBuilder', |
366 | | - '$j.fn.hoverIntent', |
| 77 | + '$.fn.hoverIntent', |
367 | 78 | 'mw.style.EmbedPlayer', |
368 | | - '$j.cookie', |
| 79 | + '$.cookie', |
369 | 80 | // Add JSON lib if browsers does not define "JSON" natively |
370 | 81 | 'JSON', |
371 | | - '$j.ui', |
372 | | - '$j.widget' |
| 82 | + '$.ui', |
| 83 | + '$.widget' |
373 | 84 | ], |
374 | 85 | [ |
375 | | - '$j.ui.mouse', |
376 | | - '$j.fn.menu', |
| 86 | + '$.ui.mouse', |
| 87 | + '$.fn.menu', |
377 | 88 | 'mw.style.jquerymenu', |
378 | | - '$j.ui.slider' |
| 89 | + '$.ui.slider' |
379 | 90 | ] |
380 | 91 | ]; |
381 | 92 | |
382 | 93 | // Pass every tag being rewritten through the update request function |
383 | | - $j( mw.getConfig( 'EmbedPlayer.RewriteTags' ) ).each( function(inx, playerElement) { |
| 94 | + $( mw.getConfig( 'EmbedPlayer.RewriteTags' ) ).each( function(inx, playerElement) { |
384 | 95 | mw.embedPlayerUpdateLibraryRequest( playerElement, dependencyRequest[ 1 ] ) |
385 | 96 | } ); |
386 | 97 | |
387 | 98 | // Add PNG fix code needed: |
388 | | - if ( $j.browser.msie && $j.browser.version < 7 ) { |
389 | | - dependencyRequest[0].push( '$j.fn.pngFix' ); |
| 99 | + if ( $.browser.msie && $.browser.version < 7 ) { |
| 100 | + dependencyRequest[0].push( '$.fn.pngFix' ); |
390 | 101 | } |
391 | 102 | |
392 | 103 | // Do short detection, to avoid extra player library request in ~most~ cases. |
393 | 104 | //( If browser is firefox include native, if browser is IE include java ) |
394 | | - if( $j.browser.msie ) { |
| 105 | + if( $.browser.msie ) { |
395 | 106 | dependencyRequest[0].push( 'mw.EmbedPlayerJava' ); |
396 | 107 | } |
397 | 108 | |
398 | 109 | // Safari gets slower load since we have to detect ogg support |
399 | | - if( !!document.createElement('video').canPlayType && !$j.browser.safari ) { |
| 110 | + if( !!document.createElement('video').canPlayType && !$.browser.safari ) { |
400 | 111 | dependencyRequest[0].push( 'mw.EmbedPlayerNative' ) |
401 | 112 | } |
402 | 113 | // Check if the iFrame player api is enabled and we have a parent iframe url: |
— | — | @@ -404,7 +115,7 @@ |
405 | 116 | mw.getConfig( 'EmbedPlayer.IframeParentUrl' ) |
406 | 117 | ){ |
407 | 118 | dependencyRequest[0].push('mw.EmbedPlayerNative'); |
408 | | - dependencyRequest[0].push('$j.postMessage'); |
| 119 | + dependencyRequest[0].push('$.postMessage'); |
409 | 120 | dependencyRequest[0].push('mw.IFramePlayerApiServer'); |
410 | 121 | } |
411 | 122 | |
— | — | @@ -423,26 +134,26 @@ |
424 | 135 | * @param {Array} dependencyRequest The library request array |
425 | 136 | */ |
426 | 137 | mw.embedPlayerUpdateLibraryRequest = function(playerElement, dependencyRequest ){ |
427 | | - var skinName = $j( playerElement ).attr( 'class' ); |
| 138 | + var skinName = $( playerElement ).attr( 'class' ); |
428 | 139 | // Set playerClassName to default if unset or not a valid skin |
429 | | - if( ! skinName || $j.inArray( skinName.toLowerCase(), mw.validSkins ) == -1 ){ |
| 140 | + if( ! skinName || $.inArray( skinName.toLowerCase(), mw.validSkins ) == -1 ){ |
430 | 141 | skinName = mw.getConfig( 'EmbedPlayer.SkinName' ); |
431 | 142 | } |
432 | 143 | skinName = skinName.toLowerCase(); |
433 | 144 | // Add the skin to the request |
434 | 145 | var skinCaseName = skinName.charAt(0).toUpperCase() + skinName.substr(1); |
435 | 146 | // The skin js: |
436 | | - if( $j.inArray( 'mw.PlayerSkin' + skinCaseName, dependencyRequest ) == -1 ){ |
| 147 | + if( $.inArray( 'mw.PlayerSkin' + skinCaseName, dependencyRequest ) == -1 ){ |
437 | 148 | dependencyRequest.push( 'mw.PlayerSkin' + skinCaseName ); |
438 | 149 | } |
439 | 150 | // The skin css |
440 | | - if( $j.inArray( 'mw.style.PlayerSkin' + skinCaseName, dependencyRequest ) == -1 ){ |
| 151 | + if( $.inArray( 'mw.style.PlayerSkin' + skinCaseName, dependencyRequest ) == -1 ){ |
441 | 152 | dependencyRequest.push( 'mw.style.PlayerSkin' + skinCaseName ); |
442 | 153 | } |
443 | 154 | |
444 | 155 | // Allow extension to extend the request. |
445 | | - $j( mw ).trigger( 'LoaderEmbedPlayerUpdateRequest', |
| 156 | + $( mw ).trigger( 'LoaderEmbedPlayerUpdateRequest', |
446 | 157 | [ playerElement, dependencyRequest ] ); |
447 | 158 | } |
448 | 159 | |
449 | | -} )( window.mw ); |
| 160 | +} )( mediaWiki, jQuery ); |
Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/modules/EmbedPlayer/tests/Player_Sources.html |
— | — | @@ -3,7 +3,7 @@ |
4 | 4 | <head> |
5 | 5 | <title>Player sources</title> |
6 | 6 | |
7 | | -<script type="text/javascript" src="../../../ResourceLoader.php?class=window.jQuery,mwEmbed&&debug=true"></script> |
| 7 | +<script type="text/javascript" src="../../../load.php?modules=startup&only=scripts&debug=true"></script> |
8 | 8 | </head> |
9 | 9 | <body> |
10 | 10 | |
Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js |
— | — | @@ -859,9 +859,6 @@ |
860 | 860 | // Selected mediaSource element. |
861 | 861 | selectedSource: null, |
862 | 862 | |
863 | | - // Media element thumbnail |
864 | | - thumbnail: null, |
865 | | - |
866 | 863 | // Media element linkback |
867 | 864 | linkback: null, |
868 | 865 | |
— | — | @@ -1070,9 +1067,9 @@ |
1071 | 1068 | }, |
1072 | 1069 | |
1073 | 1070 | /** |
1074 | | - * Returns the thumbnail URL for the media element. |
| 1071 | + * Returns the poster URL for the media element. |
1075 | 1072 | * |
1076 | | - * @returns {String} thumbnail URL |
| 1073 | + * @returns {String} poster URL |
1077 | 1074 | */ |
1078 | 1075 | getPosterSrc: function( ) { |
1079 | 1076 | return this.poster; |
— | — | @@ -1315,9 +1312,6 @@ |
1316 | 1313 | } |
1317 | 1314 | |
1318 | 1315 | // Set the poster: |
1319 | | - if ( $j( element ).attr( 'thumbnail' ) ) { |
1320 | | - _this.poster = $j( element ).attr( 'thumbnail' ); |
1321 | | - } |
1322 | 1316 | if ( $j( element ).attr( 'poster' ) ) { |
1323 | 1317 | _this.poster = $j( element ).attr( 'poster' ); |
1324 | 1318 | } |
— | — | @@ -1971,7 +1965,7 @@ |
1972 | 1966 | // Close Menu Overlay: |
1973 | 1967 | this.controlBuilder.closeMenuOverlay(); |
1974 | 1968 | |
1975 | | - // update the thumbnail html: |
| 1969 | + // update the Poster html: |
1976 | 1970 | this.updatePosterHTML(); |
1977 | 1971 | |
1978 | 1972 | this.paused = true; |
— | — | @@ -1979,7 +1973,7 @@ |
1980 | 1974 | // Make sure the controlBuilder bindings are up-to-date |
1981 | 1975 | this.controlBuilder.addControlBindings(); |
1982 | 1976 | |
1983 | | - // Once the thumbnail is shown run the mediaReady trigger (if not using |
| 1977 | + // Once the Poster is shown run the mediaReady trigger (if not using |
1984 | 1978 | // native controls) |
1985 | 1979 | if( !this.useNativePlayerControls() ){ |
1986 | 1980 | mw.log("mediaLoaded"); |
Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/resources/mediawiki/mediawiki.js |
— | — | @@ -299,7 +299,7 @@ |
300 | 300 | // Check the parameters type |
301 | 301 | if( parameters[index] && ( typeof parameters[index] == 'function' || parameters[index] instanceof jQuery ) ){ |
302 | 302 | useSwapIndex = true; |
303 | | - return '<span id="mw_message_swap_index_' + index +'"></span>' |
| 303 | + return '<span id="mw_message_swap_index_' + index +'"></span>'; |
304 | 304 | } else { |
305 | 305 | // directly swap in the index or a missing index indicator ( $1{int} |
306 | 306 | return ( index in parameters ) ? parameters[index] : '$' + match; |
— | — | @@ -930,7 +930,7 @@ |
931 | 931 | } |
932 | 932 | // Load asynchronously after doumument ready |
933 | 933 | if ( ready ) { |
934 | | - setTimeout( function() { $( 'body' ).append( request() ); }, 0 ) |
| 934 | + setTimeout( function() { $( 'body' ).append( request() ); }, 0 ); |
935 | 935 | } else { |
936 | 936 | document.write( request() ); |
937 | 937 | } |
— | — | @@ -1043,7 +1043,7 @@ |
1044 | 1044 | // Validate input |
1045 | 1045 | if ( typeof dependencies !== 'object' && typeof dependencies !== 'string' ) { |
1046 | 1046 | throw new Error( 'dependencies must be a string or an array, not a ' + |
1047 | | - typeof dependencies ) |
| 1047 | + typeof dependencies ); |
1048 | 1048 | } |
1049 | 1049 | // Allow calling with a single dependency as a string |
1050 | 1050 | if ( typeof dependencies === 'string' ) { |
— | — | @@ -1083,7 +1083,7 @@ |
1084 | 1084 | // Validate input |
1085 | 1085 | if ( typeof modules !== 'object' && typeof modules !== 'string' ) { |
1086 | 1086 | throw new Error( 'dependencies must be a string or an array, not a ' + |
1087 | | - typeof dependencies ) |
| 1087 | + typeof dependencies ); |
1088 | 1088 | } |
1089 | 1089 | // Allow calling with an external script or single dependency as a string |
1090 | 1090 | if ( typeof modules === 'string' ) { |
Index: branches/MwEmbedStandAloneRL1_17/MwEmbedStandAlone/resources/startup.js |
— | — | @@ -16,7 +16,7 @@ |
17 | 17 | * * Opera 9+ |
18 | 18 | * * Chrome 1+ |
19 | 19 | */ |
20 | | -var isCompatible = function() { |
| 20 | +var mwIsCompatible = function() { |
21 | 21 | // IE < 6 |
22 | 22 | if ( navigator.appVersion.indexOf( 'MSIE' ) !== -1 |
23 | 23 | && parseFloat( navigator.appVersion.split( 'MSIE' )[1] ) < 6 ) |