Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js |
— | — | @@ -2498,45 +2498,49 @@ |
2499 | 2499 | */ |
2500 | 2500 | getShareEmbedObject: function(){ |
2501 | 2501 | var iframeUrl = mw.getMwEmbedPath() + 'mwEmbedFrame.php?'; |
| 2502 | + var params = {}; |
2502 | 2503 | |
2503 | 2504 | if ( this.roe ) { |
2504 | | - iframeUrl += 'roe=' + escape( this.roe ) + '&'; |
2505 | | - } else if( this.apiTitleKey ) { |
2506 | | - iframeUrl += 'apiTitleKey=' + escape( this.apiTitleKey ) + '&'; |
| 2505 | + params.roe = this.roe; |
| 2506 | + } else if( this.apiTitleKey ) { |
| 2507 | + params.apiTitleKey = this.apiTitleKey; |
2507 | 2508 | if ( this.apiProvider ) { |
2508 | 2509 | // Commons always uses the commons api provider ( special hack should refactor ) |
2509 | 2510 | if( mw.parseUri( document.URL ).host == 'commons.wikimedia.org'){ |
2510 | 2511 | this.apiProvider = 'commons'; |
2511 | 2512 | } |
2512 | | - iframeUrl += 'apiProvider=' + escape( this.apiProvider ) + '&'; |
| 2513 | + params.apiProvider = this.apiProvider; |
2513 | 2514 | } |
2514 | 2515 | } else { |
2515 | 2516 | // Output all the video sources: |
2516 | 2517 | for( var i=0; i < this.mediaElement.sources.length; i++ ){ |
2517 | 2518 | var source = this.mediaElement.sources[i]; |
2518 | 2519 | if( source.src ) { |
2519 | | - iframeUrl += 'src[]=' + escape( mw.absoluteUrl( source.src ) ) + '&'; |
| 2520 | + params['src[]'] = mw.absoluteUrl( source.src ); |
2520 | 2521 | } |
2521 | 2522 | } |
2522 | 2523 | // Output the poster attr |
2523 | 2524 | if( this.poster ){ |
2524 | | - iframeUrl += 'poster=' + escape( this.poster ) + '&'; |
| 2525 | + params.poster = this.poster; |
2525 | 2526 | } |
2526 | 2527 | } |
2527 | 2528 | |
2528 | 2529 | // Set the skin if set to something other than default |
2529 | 2530 | if( this.skinName ){ |
2530 | | - iframeUrl += 'skin=' + escape( this.skinName ) + '&'; |
| 2531 | + params.skin = this.skinName; |
2531 | 2532 | } |
2532 | 2533 | |
2533 | 2534 | if( this.duration ) { |
2534 | | - iframeUrl +='durationHint=' + escape( parseFloat( this.duration ) ) + '&'; |
| 2535 | + params.durationHint = parseFloat( this.duration ); |
2535 | 2536 | } |
2536 | 2537 | // Set width / height of iframe embed ( child iframe / object can't read parent frame size ) |
2537 | | - if( this.width || this.height ){ |
2538 | | - iframeUrl += ( this.width )? 'width=' + parseInt( this.width ) + '&' : ''; |
2539 | | - iframeUrl += ( this.height )? 'height=' +parseInt( this.height ) + '&' : ''; |
| 2538 | + if( this.width ){ |
| 2539 | + params.width = parseInt( this.width ); |
2540 | 2540 | } |
| 2541 | + if( this.height ){ |
| 2542 | + params.height = parseInt( this.height ); |
| 2543 | + } |
| 2544 | + iframeUrl += $.param( params ); |
2541 | 2545 | |
2542 | 2546 | // Set up embedFrame src path |
2543 | 2547 | var embedCode = '<object data="' + mw.escapeQuotesHTML( iframeUrl ) + '" '; |