Index: branches/wmf/1.17wmf1/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: branches/wmf/1.17wmf1/extensions/OggHandler/OggHandler_body.php |
— | — | @@ -418,12 +418,12 @@ |
419 | 419 | } |
420 | 420 | |
421 | 421 | static function getMyScriptPath() { |
422 | | - global $wgScriptPath; |
423 | | - return "$wgScriptPath/extensions/OggHandler"; |
| 422 | + global $wgExtensionAssetsPath; |
| 423 | + return "$wgExtensionAssetsPath/OggHandler"; |
424 | 424 | } |
425 | 425 | |
426 | 426 | function setHeaders( $out ) { |
427 | | - global $wgOggScriptVersion, $wgCortadoJarFile, $wgServer; |
| 427 | + global $wgOggScriptVersion, $wgCortadoJarFile; |
428 | 428 | |
429 | 429 | if ( $out->hasHeadItem( 'OggHandlerScript' ) && $out->hasHeadItem( 'OggHandlerInlineScript' ) && |
430 | 430 | $out->hasHeadItem( 'OggHandlerInlineCSS' ) ) { |
— | — | @@ -441,8 +441,9 @@ |
442 | 442 | $cortadoUrl = $wgCortadoJarFile; |
443 | 443 | $scriptPath = self::getMyScriptPath(); |
444 | 444 | if( substr( $cortadoUrl, 0, 1 ) != '/' |
445 | | - && substr( $cortadoUrl, 0, 4 ) != 'http' ) { |
446 | | - $cortadoUrl = "$wgServer$scriptPath/$cortadoUrl"; |
| 445 | + && substr( $cortadoUrl, 0, 4 ) != 'http' ) |
| 446 | + { |
| 447 | + $cortadoUrl = wfExpandUrl( "$scriptPath/$cortadoUrl", PROTO_CURRENT ); |
447 | 448 | } |
448 | 449 | $encCortadoUrl = Xml::encodeJsVar( $cortadoUrl ); |
449 | 450 | $encExtPathUrl = Xml::encodeJsVar( $scriptPath ); |
— | — | @@ -514,11 +515,7 @@ |
515 | 516 | |
516 | 517 | OggTransformOutput::$serial++; |
517 | 518 | |
518 | | - if ( substr( $this->videoUrl, 0, 4 ) != 'http' ) { |
519 | | - $url = wfExpandUrl( $this->videoUrl, PROTO_CURRENT ); |
520 | | - } else { |
521 | | - $url = $this->videoUrl; |
522 | | - } |
| 519 | + $url = wfExpandUrl( $this->videoUrl, PROTO_RELATIVE ); |
523 | 520 | // Normalize values |
524 | 521 | $length = floatval( $this->length ); |
525 | 522 | $width = intval( $this->width ); |