r73914 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73913‎ | r73914 | r73915 >
Date:15:56, 28 September 2010
Author:dale
Status:deferred
Tags:
Comment:
* fixes bug 25344 where the dialog video continues to play after the dialog has been closed.
Modified paths:
  • /branches/MwEmbedStandAlone/remotes/mediaWiki.js (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/remotes/mediaWiki.js
@@ -465,12 +465,7 @@
466466 var dialogHeight = ( pheight == 0 )? 175 :
467467 ( pheight + 130 );
468468 var buttons = {};
469 - buttons[ gM( 'mwe-ok' ) ] = function(){
470 - var embedPlayer = $j( '#mwe_' + $j( _this ).data( 'playerId' ) ).get(0);
471 - // stop the player ( more healthy way to remove the video from the dom )
472 - if( embedPlayer ) {
473 - embedPlayer.stop();
474 - }
 469+ buttons[ gM( 'mwe-ok' ) ] = function(){
475470 // close the dialog
476471 $j(this).dialog( 'close' ).remove();
477472 };
@@ -479,8 +474,15 @@
480475 'content' : html_out,
481476 'buttons' : buttons,
482477 'height' : dialogHeight,
483 - 'width' : 430
484 - })
 478+ 'width' : 430,
 479+ 'close': function(event, ui) {
 480+ var embedPlayer = $j( '#mwe_' + vidId ).get(0);
 481+ // stop the player before we close the dialog
 482+ if( embedPlayer ) {
 483+ embedPlayer.stop();
 484+ }
 485+ }
 486+ });
485487
486488 // Update the embed code to use the mwEmbed player:
487489 $j( '#mwe_' + vidId ).embedPlayer( { 'autoplay' : true }, function(){

Status & tagging log