r51265 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51264‎ | r51265 | r51266 >
Date:22:50, 31 May 2009
Author:gmaxwell
Status:ok
Tags:
Comment:
Use audio tag for non-video files; Firefox 3.5pre 20090531 is failing to provide any controls at all if you use video + height=0 for audio. Using the audio tag is both more correct and it addresses this issue. However, height=0 should probably also make the audio tag invisible, so this change also causes the height to be set to controlsHeightGuess if height is 0. Finally, HTML5 uses attributeless flags for autoplay and controls rather than XHTML style attributes.
Modified paths:
  • /trunk/extensions/OggHandler/OggPlayer.js (modified) (history)

Diff [purge]

Index: trunk/extensions/OggHandler/OggPlayer.js
@@ -543,14 +543,14 @@
544544 'embedVideoElement': function ( elt, params ) {
545545 var id = elt.id + "_obj";
546546 var html =
547 - '<div><video' +
 547+ '<div><' + (params.isVideo?'video':'audio') +
548548 ' id=' + this.hq( id ) +
549549 ' width=' + this.hq( params.width ) +
550 - ' height=' + this.hq( params.height ) +
 550+ ' height=' + this.hq( (params.height>0)?params.height:this.controlsHeightGuess ) +
551551 ' src=' + this.hq( params.videoUrl ) +
552 - ' autoplay="true"';
 552+ ' autoplay';
553553 if (!this.safari)
554 - html += ' controls="true"';
 554+ html += ' controls';
555555 html += ' ></video></div>';
556556 elt.innerHTML = html;
557557 },

Follow-up revisions

RevisionCommit summaryAuthorDate
r51312OggHandler audio fix in r51265 produced incoorect HTML.gmaxwell21:29, 1 June 2009

Status & tagging log