r38693 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r38692‎ | r38693 | r38694 >
Date:08:01, 6 August 2008
Author:tstarling
Status:old
Tags:
Comment:
* Removed hack for old opera video build
* Added hack for new opera video build
Modified paths:
  • /trunk/extensions/OggHandler/OggPlayer.js (modified) (history)

Diff [purge]

Index: trunk/extensions/OggHandler/OggPlayer.js
@@ -183,7 +183,9 @@
184184 }
185185
186186 // <video> element
187 - if ( typeof HTMLVideoElement == 'object' ) {
 187+ if ( typeof HTMLVideoElement == 'object' // Firefox, Safari
 188+ || typeof HTMLVideoElement == 'function' ) // Opera
 189+ {
188190 this.clientSupports['videoElement'] = true;
189191 }
190192
@@ -504,26 +506,16 @@
505507 },
506508
507509 'embedVideoElement': function ( elt, params ) {
508 - var videoElt = document.createElement('video');
509 - videoElt.setAttribute( 'width', params.width );
510 - videoElt.setAttribute( 'height', params.height + this.controlsHeightGuess );
511 - videoElt.setAttribute( 'src', params.videoUrl );
512 - videoElt.setAttribute( 'autoplay', '1' );
513 - videoElt.setAttribute( 'controls', '1' );
514 - var div = document.createElement( 'div' );
515 - div.appendChild( videoElt );
516 - elt.appendChild( div );
517 -
518 - // Try to detect implementations that don't support controls
519 - // This works for the Opera test build
520 - if ( !videoElt.controls ) {
521 - div = document.createElement( 'div' );
522 - div.appendChild( this.newPlayButton( videoElt ) );
523 - div.appendChild( this.newPauseButton( videoElt ) );
524 - div.appendChild( this.newStopButton( videoElt ) );
525 - elt.appendChild( div );
526 - //videoElt.play();
527 - }
 510+ var id = elt.id + "_obj";
 511+ elt.innerHTML =
 512+ '<div><video' +
 513+ ' id=' + this.hq( id ) +
 514+ ' width=' + this.hq( params.width ) +
 515+ ' height=' + this.hq( params.height ) +
 516+ ' src=' + this.hq( params.videoUrl ) +
 517+ ' autoplay="1"' +
 518+ ' controls="1"' +
 519+ ' /></div>';
528520 },
529521
530522 'embedOggPlugin': function ( elt, params, player ) {

Status & tagging log