Index: trunk/extensions/OggHandler/OggPlayer.js |
— | — | @@ -51,6 +51,11 @@ |
52 | 52 | * Parameters are: id, videoUrl, width, height, length, linkUrl, isVideo |
53 | 53 | */ |
54 | 54 | 'init': function ( player, params ) { |
| 55 | + // Expand params.videoUrl if protocol-relative |
| 56 | + if ( params.videoUrl.substr( 0, 2 ) == '//' ) { |
| 57 | + // window.location.protocol is something like 'http:' |
| 58 | + params.videoUrl = window.location.protocol + params.videoUrl; |
| 59 | + } |
55 | 60 | elt = document.getElementById( params.id ); |
56 | 61 | |
57 | 62 | // Save still image HTML |
Index: trunk/extensions/OggHandler/OggHandler_body.php |
— | — | @@ -443,12 +443,12 @@ |
444 | 444 | } |
445 | 445 | |
446 | 446 | static function getMyScriptPath() { |
447 | | - global $wgScriptPath; |
448 | | - return "$wgScriptPath/extensions/OggHandler"; |
| 447 | + global $wgExtensionAssetsPath; |
| 448 | + return "$wgExtensionAssetsPath/OggHandler"; |
449 | 449 | } |
450 | 450 | |
451 | 451 | function setHeaders( $out ) { |
452 | | - global $wgOggScriptVersion, $wgCortadoJarFile, $wgServer; |
| 452 | + global $wgOggScriptVersion, $wgCortadoJarFile; |
453 | 453 | |
454 | 454 | if ( $out->hasHeadItem( 'OggHandlerScript' ) && $out->hasHeadItem( 'OggHandlerInlineScript' ) && |
455 | 455 | $out->hasHeadItem( 'OggHandlerInlineCSS' ) ) { |
— | — | @@ -466,8 +466,9 @@ |
467 | 467 | $cortadoUrl = $wgCortadoJarFile; |
468 | 468 | $scriptPath = self::getMyScriptPath(); |
469 | 469 | if( substr( $cortadoUrl, 0, 1 ) != '/' |
470 | | - && substr( $cortadoUrl, 0, 4 ) != 'http' ) { |
471 | | - $cortadoUrl = "$wgServer$scriptPath/$cortadoUrl"; |
| 470 | + && substr( $cortadoUrl, 0, 4 ) != 'http' ) |
| 471 | + { |
| 472 | + $cortadoUrl = wfExpandUrl( "$scriptPath/$cortadoUrl", PROTO_CURRENT ); |
472 | 473 | } |
473 | 474 | $encCortadoUrl = Xml::encodeJsVar( $cortadoUrl ); |
474 | 475 | $encExtPathUrl = Xml::encodeJsVar( $scriptPath ); |
— | — | @@ -540,12 +541,7 @@ |
541 | 542 | |
542 | 543 | OggTransformOutput::$serial++; |
543 | 544 | |
544 | | - if ( substr( $this->videoUrl, 0, 4 ) != 'http' ) { |
545 | | - global $wgServer; |
546 | | - $url = $wgServer . $this->videoUrl; |
547 | | - } else { |
548 | | - $url = $this->videoUrl; |
549 | | - } |
| 545 | + $url = wfExpandUrl( $this->videoUrl, PROTO_RELATIVE ); |
550 | 546 | // Normalize values |
551 | 547 | $length = floatval( $this->length ); |
552 | 548 | $width = intval( $this->width ); |