r62728 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62727‎ | r62728 | r62729 >
Date:03:36, 20 February 2010
Author:dale
Status:deferred
Tags:
Comment:
* added warning about firebug
* updated unique request id for deployment.
* major skin refactor
* some simplification of mw.EmbedPlayer loader
* IE6 fixes and tests ( java cortado )
* fixed a mwEmbed core loader bug
Modified paths:
  • /branches/js2-work/phase3/js/mwEmbed/includes/languages/mwEmbed.i18n.php (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.Firefogg.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.FirefoggGUI.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/loader.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/mw.EmbedPlayer.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/vlcEmbed.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedText.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/mwEmbed.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/remotes/mediaWiki.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/skins/common/common.css (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/skins/common/images/kaltura_logo_sm_transparent.png (added) (history)
  • /branches/js2-work/phase3/js/mwEmbed/skins/common/images/kaltura_logo_sm_white.png (added) (history)
  • /branches/js2-work/phase3/js/mwEmbed/skins/ctrlBuilder.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/skins/kskin/images/kaltura_open_source_video_platform.png (replaced) (history)
  • /branches/js2-work/phase3/js/mwEmbed/skins/kskin/kskinConfig.js (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/skins/mvpcf/EmbedPlayer.css (modified) (history)
  • /branches/js2-work/phase3/js/mwEmbed/tests/Player_Themable.html (modified) (history)

Diff [purge]

Index: branches/js2-work/phase3/js/mwEmbed/skins/ctrlBuilder.js
@@ -39,9 +39,7 @@
4040
4141 // All playback types support kalturaAttribution
4242 // to enable or disable use mw.setConfig( 'kalturaAttribution', [true|false] )
43 - 'kalturaAttribution' : true,
44 -
45 - 'playButtonLarge' : true
 43+ 'kalturaAttribution' : true
4644 },
4745 /**
4846 * Initialization Object for the control builder
@@ -129,6 +127,11 @@
130128 // Build component output:
131129 for ( var component_id in this.components ) {
132130
 131+ // Check for explit skip (component === false )
 132+ if( this.components[ component_id ] === false ){
 133+ continue;
 134+ }
 135+
133136 // Special case with playhead skip if we have > 30px of space for it
134137 if ( component_id == 'playHead' && this.available_width < 30 ){
135138 continue;
@@ -187,16 +190,14 @@
188191
189192 // Setup target shortcut to control-bar
190193 $target = embedPlayer.$interface;
191 -
192 -
193194
194195 // Add recommend firefox if we have non-native playback:
195196 if ( _this.checkNativeWarning( ) ) {
196197 _this.doNativeWarning();
197198 }
198 -
199 - if ( $j.browser.msie && $j.browser.version <= 6 ) {
200 - $j( embedPlayer.id + ' .play-btn-large' ).pngFix();
 199+
 200+ if ( $j.browser.msie && $j.browser.version <= 6 ) {
 201+ $j('#' + embedPlayer.id + ' .play-btn-large' ).pngFix();
201202 }
202203
203204
@@ -298,8 +299,9 @@
299300 this.doVolumeBinding();
300301
301302 // Check if we have any custom skin Bindings to run
302 - if ( this.addSkinControlBindings && typeof( this.addSkinControlBindings ) == 'function' )
 303+ if ( this.addSkinControlBindings && typeof( this.addSkinControlBindings ) == 'function' ){
303304 this.addSkinControlBindings();
 305+ }
304306 },
305307 closeMenuOverlay: function(){
306308 var _this = this;
@@ -452,7 +454,7 @@
453455 },
454456 function() {
455457 hoverOverDelay = false;
456 - setTimeout( function doHideVolume() {
 458+ setTimeout( function() {
457459 if ( !hoverOverDelay ) {
458460 $targetvol.fadeOut( 'fast' );
459461 }
@@ -587,16 +589,19 @@
588590 'o' : function( ctrlObj ){
589591 return $j( '<div />' )
590592 .attr( 'title', gM( 'mwe-kaltura-platform-title' ) )
591 - .addClass( 'ui-state-default ui-corner-all ui-icon_link rButton k-attribution' )
 593+ .addClass( 'ui-state-default ui-corner-all ui-icon_link rButton' )
592594 .append(
593595 $j('<span />')
594 - .addClass( 'ui-icon k-attribution' )
 596+ .addClass( 'ui-icon kaltura-icon' )
595597 )
 598+ .unbind()
 599+ .buttonHover()
596600 .click( function( ) {
597601 window.location = 'http://kaltura.com';
598602 } );
599603 }
600604 },
 605+
601606 /**
602607 * The options button, invokes display of the options menu
603608 */
@@ -668,7 +673,7 @@
669674 'volumeControl': {
670675 'w' : 28,
671676 'o' : function( ctrlObj ) {
672 - $volumeOut = $j( '<div />' );
 677+ $volumeOut = $j( '<span />' );
673678 if ( ctrlObj.volume_layout == 'horizontal' ) {
674679 $volumeOut.append(
675680 $j( '<div />' )
@@ -687,7 +692,7 @@
688693 );
689694
690695 if ( ctrlObj.volume_layout == 'vertical' ) {
691 - $volumeOut.append(
 696+ $volumeOut.find('.volume_control').append(
692697 $j( '<div />' )
693698 .css( {
694699 'position' : 'absolute',
@@ -701,7 +706,8 @@
702707 )
703708 );
704709 }
705 - return $volumeOut;
 710+ //Return the inner html
 711+ return $volumeOut.html();
706712 }
707713 },
708714
Index: branches/js2-work/phase3/js/mwEmbed/skins/common/common.css
@@ -468,3 +468,13 @@
469469 .interface_wrap{
470470 position:relative;
471471 }
 472+
 473+.kaltura-icon {
 474+ background-image:url('images/kaltura_logo_sm_transparent.png') !important;
 475+ background-repeat:no-repeat;
 476+ display: block;
 477+ height: 12px;
 478+ width: 12px;
 479+ margin-top: -6px !important;
 480+ margin-left: 3px !important;
 481+}
\ No newline at end of file
Index: branches/js2-work/phase3/js/mwEmbed/skins/common/images/kaltura_logo_sm_transparent.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/js2-work/phase3/js/mwEmbed/skins/common/images/kaltura_logo_sm_transparent.png
___________________________________________________________________
Added: svn:mime-type
472482 + application/octet-stream
Index: branches/js2-work/phase3/js/mwEmbed/skins/common/images/kaltura_logo_sm_white.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/js2-work/phase3/js/mwEmbed/skins/common/images/kaltura_logo_sm_white.png
___________________________________________________________________
Added: svn:mime-type
473483 + application/octet-stream
Index: branches/js2-work/phase3/js/mwEmbed/skins/mvpcf/EmbedPlayer.css
@@ -158,7 +158,7 @@
159159 width:10px;
160160 height:15px;
161161 margin-left:-5px;
162 - margin-top:1px;
 162+ margin-top:0px;
163163 }
164164
165165 .mv-player .inOutSlider .ui-slider-handle{
Property changes on: branches/js2-work/phase3/js/mwEmbed/skins/kskin/images/kaltura_open_source_video_platform.png
___________________________________________________________________
Added: svn:mergeinfo
166166 Merged /branches/sqlite/js2/mwEmbed/skins/kskin/images/kaltura_open_source_video_platform.png:r58211-58321
167167 Merged /branches/REL1_15/phase3/js2/mwEmbed/skins/kskin/images/kaltura_open_source_video_platform.png:r51646
Index: branches/js2-work/phase3/js/mwEmbed/skins/kskin/kskinConfig.js
@@ -24,7 +24,7 @@
2525 'playerSelect',
2626 'download',
2727 'share',
28 - 'credits',
 28+ 'credits'
2929 ],
3030
3131 // Extends base components with kskin specific options:
@@ -79,7 +79,7 @@
8080 .addClass( 'k-menu ui-widget-content' )
8181 .css( {
8282 'width' : ctrlObj.getOverlayWidth(),
83 - 'height' : ctrlObj.getOverlayHeight(),
 83+ 'height' : ctrlObj.getOverlayHeight()
8484 } );
8585
8686 // Setup menu offset ( if player height < getOverlayHeight )
@@ -268,14 +268,6 @@
269269 embedPlayer.$interface.find( '.menu-' + menu_item )
270270 );
271271 }
272 - },
273 -
274 - /**
275 - * Show the "edit with kaltura" screen ( specific to kaltura skin )
276 - * NOTE: stub function
277 - */
278 - showKalturaEdit: function(){
279 -
280272 },
281273
282274 /**
Index: branches/js2-work/phase3/js/mwEmbed/modules/TimedText/mw.TimedText.js
@@ -1335,7 +1335,7 @@
13361336 $.fn.timedText = function ( action, target ){
13371337 if( !target )
13381338 options = action;
1339 - if( !options )
 1339+ if( typeof options == 'undefined' )
13401340 options = {};
13411341
13421342 $j( this.selector ).each(function(){
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.Firefogg.js
@@ -4,14 +4,14 @@
55 */
66
77 mw.addMessages({
8 - "mwe-upload-transcode-in-progress" : "Transcode and upload in progress (do not close this window)",
9 -
 8+ "mwe-upload-transcode-in-progress" : "Transcode and upload in progress (do not close this window)",
109 "fogg-transcoding" : "Encoding video to ogg",
1110 "fogg-select_file" : "Select file",
1211 "fogg-select_new_file" : "Select new file",
1312 "fogg-select_url" : "Select URL",
1413 "fogg-check_for_firefogg" : "Checking for Firefogg...",
15 - "fogg-installed" : "Firefogg is installed",
 14+ "fogg-installed" : "Firefogg is installed,",
 15+ "fogg-not-installed" : "Firefogg is not installed",
1616 "fogg-for_improved_uploads" : "For improved uploads:",
1717 "fogg-please-install" : "$1. More $2",
1818 "fogg-please-install-install-linktext" : "Install firefogg",
@@ -21,7 +21,8 @@
2222 "fogg-encoding-done" : "Encoding complete",
2323 "fogg-badtoken" : "Token is not valid",
2424 "fogg-preview" : "Preview video",
25 - "fogg-hidepreview" : "Hide preview"
 25+ "fogg-hidepreview" : "Hide preview",
 26+ "fogg-warning-firebug" : "<b>Firebug</b> can cause conflicts with <i>Firefogg</i>. Please disable <b>Firebug</b> for this page."
2627 });
2728
2829 var firefogg_install_links = {
@@ -127,12 +128,18 @@
128129 'audioBitrate' : '96',
129130 'noUpscaling' : true
130131 },
131 - have_firefogg: null, // lazy initialised, use getFirefogg()
132 - current_encoder_settings: null, // lazy initialised, use getEncoderSettings()
133 - sourceFileInfo: null, // lazy initialised, use getSourceFileInfo()
 132+ // lazy initialised, use getFirefogg()
 133+ have_firefogg: null,
 134+
 135+ // lazy initialised, use getEncoderSettings()
 136+ current_encoder_settings: null,
 137+
 138+ // lazy initialised, use getSourceFileInfo()
 139+ sourceFileInfo: null,
 140+
 141+ // Valid ogg extensions
134142 ogg_extensions: [ 'ogg', 'ogv', 'oga' ],
135 - video_extensions: [ 'avi', 'mov', 'mp4', 'mp2', 'mpeg', 'mpeg2', 'mpeg4', 'dv', 'wmv' ],
136 -
 143+
137144 passthrough: false,
138145 sourceMode: 'file',
139146
@@ -168,8 +175,7 @@
169176 this[i] = myBUI[i];
170177 }
171178 }
172 - }
173 -
 179+ }
174180 if ( !this.selector ) {
175181 mw.log('firefogg: missing selector ');
176182 }
@@ -289,47 +295,9 @@
290296 .click( function() {
291297 _this.selectSourceFile();
292298 });
293 - } else {
294 - // Firefogg disabled
295 - // FIXME: move this elsewhere. None of this is related to binding.
 299+ }
 300+
296301
297 - // Show the "use latest Firefox" message if necessary
298 - if ( !( $j.browser.mozilla && $j.browser.version >= '1.9.1' ) ) {
299 - mw.log( 'show use latest::' + _this.target_use_latest_firefox );
300 - if ( _this.target_use_latest_firefox ) {
301 - if ( _this.form_type == 'upload' )
302 - $j( _this.target_use_latest_firefox )
303 - .prepend( gM( 'fogg-for_improved_uploads' ) );
304 -
305 - $j( _this.target_use_latest_firefox ).show();
306 - }
307 - return;
308 - }
309 -
310 - // Otherwise show the "install Firefogg" message
311 - var upMsg = ( _this.form_type == 'upload' ) ? gM( 'fogg-for_improved_uploads' ) : '';
312 - var firefoggUrl = _this.getFirefoggInstallUrl();
313 - if( firefoggUrl ){
314 - $j( _this.target_please_install )
315 - .html( upMsg +
316 - gM( 'fogg-please-install', [
317 - // Install link
318 - $j('<a />')
319 - .text( gM( "fogg-please-install-install-linktext" ) )
320 - .attr('href', firefoggUrl ),
321 -
322 - // About link
323 - $j('<a />')
324 - .text( gM( "fogg-please-install-about-linktext" ) )
325 - .attr( 'href', 'http://commons.wikimedia.org/wiki/Commons:Firefogg' )
326 -
327 - ])
328 - )
329 - .css( 'padding', '10px' )
330 - .show();
331 - }
332 - }
333 -
334302 // Set up the click handler for the "save local file" button
335303 if( _this.target_btn_save_local_file ){
336304 $j( _this.target_btn_save_local_file )
@@ -339,7 +307,67 @@
340308 } );
341309 }
342310 },
 311+
 312+ /**
 313+ * Show the install firefogg msg
 314+ */
 315+ showInstallFirefog: function(){
 316+ var _this = this;
 317+
 318+ var upMsg = ( _this.form_type == 'upload' ) ?
 319+ gM( 'fogg-for_improved_uploads' ) + ' ' : gM( 'fogg-not-installed') + ' ';
 320+
 321+ // Show the "use latest Firefox" message if necessary
 322+ mw.log( 'bv: ' + mw.versionIsAtLeast( '1.9.1', $j.browser.version ) );
 323+ if ( !( $j.browser.mozilla && mw.versionIsAtLeast( '1.9.1', $j.browser.version ) ) ) {
 324+ mw.log( 'show use latest::' + _this.target_use_latest_firefox );
 325+
 326+ // Add the use_latest if not present:
 327+ if ( !this.target_use_latest_firefox ) {
 328+ $j( this.selector ).after( this.getControlHtml( 'target_use_latest_firefox' ) );
 329+ this.target_use_latest_firefox = this.selector + ' ~ .target_use_latest_firefox';
 330+ }
 331+
 332+ // Add the upload msg if we are "uploading"
 333+ if ( _this.form_type == 'upload' ){
 334+ $j( _this.target_use_latest_firefox )
 335+ .prepend( upMsg );
 336+ }
 337+
 338+ $j( _this.target_use_latest_firefox ).show();
 339+ return ;
 340+ }
 341+ mw.log( 'should show install link');
343342
 343+ // Otherwise show the "install Firefogg" message
 344+ var firefoggUrl = _this.getFirefoggInstallUrl();
 345+ if( firefoggUrl ){
 346+
 347+ // Add the target please install in not present:
 348+ if ( !this.target_please_install ) {
 349+ $j( this.selector ).after( this.getControlHtml( 'target_please_install' ) );
 350+ this.target_please_install = this.selector + ' ~ .target_please_install';
 351+ }
 352+ // Add the install msg
 353+ $j( _this.target_please_install )
 354+ .html( upMsg +
 355+ gM( 'fogg-please-install', [
 356+ // Install link
 357+ $j('<a />')
 358+ .text( gM( "fogg-please-install-install-linktext" ) )
 359+ .attr('href', firefoggUrl ),
 360+
 361+ // About link
 362+ $j('<a />')
 363+ .text( gM( "fogg-please-install-about-linktext" ) )
 364+ .attr( 'href', 'http://commons.wikimedia.org/wiki/Commons:Firefogg' )
 365+ ])
 366+ )
 367+ .css( 'padding', '10px' )
 368+ .show();
 369+ }
 370+ },
 371+
344372 /*
345373 * Get the URL for installing firefogg on the client OS
346374 */
@@ -362,7 +390,7 @@
363391 getFirefogg: function() {
364392 if ( this.have_firefogg == null ) {
365393 if ( typeof( Firefogg ) != 'undefined'
366 - && Firefogg().version >= this.min_firefogg_version )
 394+ && mw.versionIsAtLeast(this.min_firefogg_version, Firefogg().version ) )
367395 {
368396 this.have_firefogg = true;
369397 this.fogg = new Firefogg();
@@ -379,6 +407,7 @@
380408 */
381409 setupForm: function() {
382410 mw.log( 'firefogg::setupForm::' );
 411+
383412 var _this = this;
384413 // Set up the parent if we are in upload mode
385414 if ( this.form_type == 'upload' ) {
@@ -386,18 +415,26 @@
387416 }
388417
389418 // If Firefogg is not available, just show a "please install" message
390 - if ( ! _this.getFirefogg() ) {
391 - if ( !this.target_please_install ) {
392 - $j( this.selector ).after( this.getControlHtml( 'target_please_install' ) );
393 - this.target_please_install = this.selector + ' ~ .target_please_install';
394 - }
395 - if ( !this.target_use_latest_firefox ) {
396 - $j( this.selector ).after( this.getControlHtml( 'target_use_latest_firefox' ) );
397 - this.target_use_latest_firefox = this.selector + ' ~ .target_use_latest_firefox';
398 - }
399 - // Show download link
400 - this.bindControls();
 419+ if ( ! _this.getFirefogg() ) {
 420+ // Show install firefogg msg
 421+ this.showInstallFirefog();
401422 return;
 423+ }
 424+
 425+ // If uploading and firefogg is on show warning
 426+ if ( this.form_type == 'upload'
 427+ && typeof console != 'undefined'
 428+ && console.firebug ){
 429+ $j( this.selector ).after(
 430+ $j( '<div />' )
 431+ .addClass( 'ui-state-error ui-corner-all' )
 432+ .html( gM( 'fogg-warning-firebug' ) )
 433+ .css({
 434+ 'width' : 'auto',
 435+ 'margin' : '5px',
 436+ 'padding' : '5px'
 437+ })
 438+ );
402439 }
403440
404441 // Change the file browser to type text. We can't simply change the attribute so
Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.FirefoggGUI.js
@@ -321,10 +321,20 @@
322322 }
323323 return this;
324324 },
325 -
 325+
 326+ /**
 327+ * Setup the form
 328+ */
326329 setupForm: function() {
327330 //empty out the selector:
328331 $j( this.selector ).empty();
 332+ // Check for firefogg:
 333+ if ( ! this.getFirefogg() ) {
 334+ // Show install firefogg msg
 335+ this.showInstallFirefog();
 336+ $j('.target_please_install').css( { 'width': 400, 'margin':'auto' } );
 337+ return;
 338+ }
329339 this.createControls();
330340 this.bindControls();
331341 },
@@ -372,7 +382,7 @@
373383 },
374384
375385 // Custom advanced target rewrites
376 - getControlHtml: function( target ) {
 386+ getControlHtml: function( target ) {
377387 switch ( target ) {
378388 case 'target_btn_select_file':
379389 case 'target_btn_select_new_file':
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/mw.EmbedPlayer.js
@@ -362,7 +362,7 @@
363363 }
364364
365365 // Firefox gives 300x150 css values OR -1 if video has not loaded metadata yet:
366 - // We check that and delay swaping in the player interface
 366+ // We check that and delay swapping in the player interface
367367 var waitForMeta = (
368368 (
369369 (
@@ -388,7 +388,7 @@
389389 ) ? true : false;
390390
391391 // Load any skins we need then swap in the interface
392 - mw.load( skinClassRequest, function(){
 392+ mw.load( skinClassRequest, function(){
393393 switch( element.tagName.toLowerCase() ) {
394394 case 'playlist':
395395 // Make sure we have the necessary playlist libs loaded:
@@ -418,7 +418,7 @@
419419 ranPlayerSwapFlag = true;
420420 var playerInterface = new mw.EmbedPlayer( element , attributes);
421421 _this.swapEmbedPlayerElement( element, playerInterface );
422 - // Issue the checkPlayerSources call to the new player interface:
 422+ // Issue the checkPlayerSources call to the new player interface:
423423 $j( '#' + $j( element ).attr('id') ).get(0).checkPlayerSources();
424424 }
425425
@@ -1214,8 +1214,9 @@
12151215 }
12161216
12171217 // Set the default skin if unset:
1218 - if ( !this.skinName )
 1218+ if ( !this.skinName ){
12191219 this.skinName = mw.getConfig( 'skinName' );
 1220+ }
12201221
12211222
12221223 // Make sure startOffset is cast as an float:
@@ -1356,10 +1357,10 @@
13571358 mw.log( 'set loading_external_data=false' );
13581359 _this.loading_external_data = false;
13591360
1360 - _this.checkForTimedText();
 1361+ _this.checkForTimedText();
13611362 } );
13621363 }else{
1363 - _this.checkForTimedText();
 1364+ _this.checkForTimedText();
13641365 }
13651366 },
13661367
@@ -1407,6 +1408,7 @@
14081409 */
14091410 checkForTimedText: function( ){
14101411 var _this = this;
 1412+ mw.log( 'checkForTimedText: ' + this.id );
14111413 // Check for timedText support
14121414 if( this.isTimedTextSupported() ){
14131415 mw.load( 'TimedText', function(){
@@ -1427,6 +1429,7 @@
14281430 * Sets load error if no source is playable
14291431 */
14301432 setupSourcePlayer: function(){
 1433+ mw.log("setupSourcePlayer: " + this.id );
14311434 // Autoseletct the media source
14321435 this.mediaElement.autoSelectSource();
14331436 // Auto select player based on default order
@@ -1472,7 +1475,7 @@
14731476 * @param {Function} callback Function to be called once playback-system has been inherited
14741477 */
14751478 inheritEmbedPlayer: function( callback ) {
1476 - mw.log( "inheritEmbedPlayer:duration is: " + this.getDuration() );
 1479+ mw.log( "inheritEmbedPlayer:duration is: " + this.getDuration() + ' p: ' + this.id);
14771480
14781481 // Clear out any non-base embedObj methods:
14791482 if ( this.instanceOf ) {
@@ -1493,7 +1496,7 @@
14941497 // Load the selected player
14951498 this.selected_player.load( function() {
14961499 // Get the selected player Interface
1497 - eval( ' var playerInterface =' + _this.selected_player.library + 'Embed;' );
 1500+ var playerInterface = window[ _this.selected_player.library + 'Embed' ];
14981501
14991502 for ( var method in playerInterface ) {
15001503 if ( _this[method] && !_this['parent_' + method] ){
@@ -2243,7 +2246,7 @@
22442247
22452248 if ( this.play_button == true && this.controls == true ){
22462249 $thumb.append(
2247 - this.ctrlBuilder.getComponent( 'play-btn-large' )
 2250+ this.ctrlBuilder.getComponent( 'playButtonLarge' )
22482251 );
22492252 }
22502253 return $thumb;
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/vlcEmbed.js
@@ -1,5 +1,5 @@
22 /*
3 -* vlc embed based on: http://people.videolan.org/~damienf/plugin-0.8.6.html
 3+* VLC embed based on: http://people.videolan.org/~damienf/plugin-0.8.6.html
44 * javascript api: http://www.videolan.org/doc/play-howto/en/ch04.html
55 * assume version > 0.8.5.1
66 */
@@ -21,7 +21,7 @@
2222 'overlay':false
2323 },
2424
25 - // The previus state of the player instance
 25+ // The previous state of the player instance
2626 prevState : 0,
2727
2828 // Counter for waiting for vlc embed to be ready
@@ -32,7 +32,7 @@
3333 */
3434 doEmbedHTML: function() {
3535 var _this = this;
36 - /*$j( this ).html(
 36+ $j( this ).html(
3737 '<object classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" ' +
3838 'codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab#Version=0,8,6,0" ' +
3939 'id="' + this.pid + '" events="True" height="' + this.height + '" width="' + this.width + '"' +
@@ -50,14 +50,14 @@
5151 'style="width:' + this.width + 'px;height:' + this.height + 'px;" ' +
5252 '>' +
5353 '</object>'
54 - )*/
55 - $j( this ).html(
 54+ )
 55+ /*$j( this ).html(
5656 '<embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" version="VideoLAN.VLCPlugin.2" '+
5757 'width="' + this.width +'" ' +
5858 'height="' + this.height + '" ' +
5959 'id="' + this.pid + '"> ' +
6060 '</embed>'
61 - );
 61+ );*/
6262
6363
6464 // give VLC 150ms to initialize before we start playback
Index: branches/js2-work/phase3/js/mwEmbed/modules/EmbedPlayer/loader.js
@@ -142,21 +142,22 @@
143143 dependencyRequest[0].push( mw.valid_skins[n] + 'Config' );
144144 }
145145 }
146 - //Also add the text library to request set if any video element has text sources:
147 - if(!addTimedTextReqFlag){
 146+ // If add timed text flag not already set check for itext, and sources
 147+ if( !addTimedTextReqFlag ){
148148 if( $j( playerElement ).find( 'itext' ).length != 0 ){
149149 // Has an itext child include timed text request
150150 addTimedTextReqFlag = true;
151 - }else{
152 - $j( playerElement ).find( 'source' ).each(function(na, sourceElement){
153 - if( $j( sourceElement ).attr('type') == 'text/xml' &&
154 - $j( sourceElement ).attr('codec') == 'roe'
155 - ){
156 - // Has a roe src
157 - addTimedTextReqFlag = true;
158 - }
159 - });
 151+ // break out of the loop
 152+ return false;
160153 }
 154+ // Check for ROE pointer or apiTitleKey
 155+ if ( $j( playerElement ).attr('roe')
 156+ || $j( playerElement ).attr( 'apiTitleKey' ) )
 157+ {
 158+ addTimedTextReqFlag = true;
 159+ // break out of the loop
 160+ return false;
 161+ }
161162 }
162163 } );
163164
Index: branches/js2-work/phase3/js/mwEmbed/mwEmbed.js
@@ -1227,11 +1227,11 @@
12281228 {
12291229 break;
12301230 }
1231 - var func = mwLoadDoneCB[ requestName ].pop();
 1231+ var func = mwLoadDoneCB[ requestName ].pop();
12321232 if( typeof func == 'function' ){
12331233 func( requestName );
12341234 }else{
1235 - mw.log('mwLoadDoneCB: error not a callback function');
 1235+ mw.log('mwLoadDoneCB: Error non callback function on stack');
12361236 }
12371237 }
12381238 // Set the load request name to done
@@ -1248,11 +1248,11 @@
12491249 if( mwLoadDoneCB[ requestName ] == 'done' ){
12501250 callback( requestName )
12511251 }
1252 - // Add it to the function queue
1253 - if( ! mwLoadDoneCB[ requestName ] || mwLoadDoneCB[ requestName ].length ){
 1252+ // Setup the function queue if unset
 1253+ if( ! mwLoadDoneCB[ requestName ] ){
12541254 mwLoadDoneCB[ requestName ] = [];
12551255 }
1256 - mwLoadDoneCB[ requestName ].push( callback );
 1256+ mwLoadDoneCB[ requestName ].push( callback );
12571257 };
12581258
12591259 /**
@@ -1687,8 +1687,8 @@
16881688 /**
16891689 * Old IE and non-Firebug debug: ( commented out for now )
16901690 */
1691 -
16921691 /*
 1692+
16931693 var log_elm = document.getElementById('mv_js_log');
16941694 if(!log_elm){
16951695 document.getElementsByTagName("body")[0].innerHTML = document.getElementsByTagName("body")[0].innerHTML +
@@ -1702,6 +1702,7 @@
17031703 log_elm.value+=string+"\n";
17041704 }
17051705 */
 1706+
17061707 }
17071708 }
17081709
@@ -2518,7 +2519,36 @@
25192520 }
25202521 });
25212522 }
 2523+
25222524 /**
 2525+ * A version comparison utility function
 2526+ * Handles version of types {Major}.{MinorN}.{Patch}
 2527+ *
 2528+ * Note this just handles version numbers not patch letters.
 2529+ *
 2530+ * @param {String} minVersion Minnium version needed
 2531+ * @param {String} clientVersion Client version to be checked
 2532+
 2533+ * @return
 2534+ * true if the version is at least of minVersion
 2535+ * false if the version is less than minVersion
 2536+ */
 2537+ mw.versionIsAtLeast = function( minVersion, clientVersion ) {
 2538+ var minVersionParts = minVersion.split('.')
 2539+ var clientVersionParts = clientVersion.split('.');
 2540+ for( var i =0; i < minVersionParts.length; i++ ) {
 2541+ if( parseInt( clientVersionParts[i] ) > parseInt( minVersionParts[i] ) ){
 2542+ return true;
 2543+ }
 2544+ if( parseInt( clientVersionParts[i] ) < parseInt( minVersionParts[i] ) ){
 2545+ return false;
 2546+ }
 2547+ }
 2548+ // Same version:
 2549+ return true;
 2550+ }
 2551+
 2552+ /**
25232553 * Utility jQuery bindings
25242554 * Setup after jQuery is available ).
25252555 */
Index: branches/js2-work/phase3/js/mwEmbed/remotes/mediaWiki.js
@@ -4,7 +4,7 @@
55 */
66 var urlparts = getRemoteEmbedPath();
77 var mwEmbedHostPath = urlparts[0];
8 -var mwRemoteVersion = 'r97';
 8+var mwRemoteVersion = 'r98';
99 var mwUseScriptLoader = true;
1010
1111 // Log the mwRemote version ( will determine what version of js we get )
Index: branches/js2-work/phase3/js/mwEmbed/tests/Player_Themable.html
@@ -10,8 +10,8 @@
1111 <link rel="stylesheet" href="../skins/styles.css" type="text/css" media="screen" />
1212 <link rel="stylesheet" href="../skins/mvpcf/EmbedPlayer.css" type="text/css" media="screen" />
1313 <link rel="stylesheet" href="../skins/kskin/EmbedPlayer.css" type="text/css" media="screen" />
14 - -->
15 -
 14+
 15+ -->
1616 <script type="text/javascript" src="../mwEmbed.js?debug=true"></script>
1717
1818
@@ -24,6 +24,7 @@
2525
2626 <div style="width:450px;float:left">
2727 <video
 28+ style="width:400px;height:300px"
2829 src="http://localhost/lucky.ogv"
2930 poster="http://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Charles_Lindbergh_flight_to_Brussels.ogg/mid-Charles_Lindbergh_flight_to_Brussels.ogg.jpg"
3031 apiTitleKey="Charles_Lindbergh_flight_to_Brussels.ogg"
@@ -31,7 +32,7 @@
3233 durationHint="60" >
3334 </video>
3435
35 -<!--
 36+
3637 <video
3738 style="width:208px;height:160px;float:left"
3839 src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg"
@@ -48,6 +49,7 @@
4950 <div style="width:450px;float:left">
5051 <video
5152 class="kskin"
 53+ style="width:400px;height:300px"
5254 src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg"
5355 apiTitleKey="Charles_Lindbergh_flight_to_Brussels.ogg"
5456 apiProvider="commons"
@@ -62,13 +64,13 @@
6365 poster="http://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Charles_Lindbergh_flight_to_Brussels.ogg/mid-Charles_Lindbergh_flight_to_Brussels.ogg.jpg"
6466 durationHint="60">
6567 </video>
66 - -->
 68+
6769 <b>(kskin) Source Code used:</b><br>
6870 <textarea cols="50" rows="7"><video class="kskin" style="width:400px;height:288px" poster="http://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Charles_Lindbergh_flight_to_Brussels.ogg/mid-Charles_Lindbergh_flight_to_Brussels.ogg.jpg"
6971 src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg"></video></textarea>
7072 </div>
 73+
7174
72 -
7375 </body>
7476 </html>
7577
Index: branches/js2-work/phase3/js/mwEmbed/includes/languages/mwEmbed.i18n.php
@@ -15,7 +15,6 @@
1616 * js file: /skins/kskin/kskinConfig.js
1717 */
1818 'mwe-credit-title' => 'Title: $1',
19 - 'mwe-kaltura-platform-title' => 'Kaltura open source video platform',
2019
2120 /*
2221 * js file: /modules/Sequencer/mw.TimedEffectsEdit.js
@@ -163,6 +162,7 @@
164163 'mwe-no-player' => 'No player available for $1',
165164 'mwe-share_this_video' => 'Share this video',
166165 'mwe-video_credits' => 'Video credits',
 166+ 'mwe-kaltura-platform-title' => 'Kaltura open source video platform',
167167 'mwe-menu_btn' => 'Menu',
168168 'mwe-close_btn' => 'Close',
169169 'mwe-ogg-player-vlc-player' => 'VLC player',
@@ -397,7 +397,8 @@
398398 'fogg-select_new_file' => 'Select new file',
399399 'fogg-select_url' => 'Select URL',
400400 'fogg-check_for_firefogg' => 'Checking for Firefogg...',
401 - 'fogg-installed' => 'Firefogg is installed',
 401+ 'fogg-installed' => 'Firefogg is installed,',
 402+ 'fogg-not-installed' => 'Firefogg is not installed',
402403 'fogg-for_improved_uploads' => 'For improved uploads:',
403404 'fogg-please-install' => '$1. More $2',
404405 'fogg-please-install-install-linktext' => 'Install firefogg',
@@ -408,6 +409,7 @@
409410 'fogg-badtoken' => 'Token is not valid',
410411 'fogg-preview' => 'Preview video',
411412 'fogg-hidepreview' => 'Hide preview',
 413+ 'fogg-warning-firebug' => '<b>Firebug</b> can cause conflicts with <i>Firefogg</i>. Please disable <b>Firebug</b> for this page.',
412414
413415 /*
414416 * js file: /modules/AddMedia/jquery.dragDropFile.js

Status & tagging log