r48457 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48456‎ | r48457 | r48458 >
Date:20:43, 16 March 2009
Author:dale
Status:ok (Comments)
Tags:
Comment:
added try catch around safari check canPlayType check
Modified paths:
  • /trunk/extensions/OggHandler/OggPlayer.js (modified) (history)

Diff [purge]

Index: trunk/extensions/OggHandler/OggPlayer.js
@@ -191,12 +191,16 @@
192192 {
193193 //do another test for safari:
194194 if( wgOggPlayer.safari ){
195 - dummyvid = document.createElement("video");
196 - if (dummyvid.canPlayType("video/ogg;codecs=\"theora,vorbis\"") == "probably")
197 - {
198 - this.clientSupports['videoElement'] = true;
199 - } else {
200 - /* could add some user nagging to install the xiph qt */
 195+ try{
 196+ var dummyvid = document.createElement("video");
 197+ if (dummyvid.canPlayType("video/ogg;codecs=\"theora,vorbis\"") == "probably")
 198+ {
 199+ this.clientSupports['videoElement'] = true;
 200+ } else {
 201+ /* could add some user nagging to install the xiph qt */
 202+ }
 203+ }catch(e){
 204+ //could not use canPlayType
201205 }
202206 }else{
203207 this.clientSupports['videoElement'] = true;

Comments

#Comment by Brion VIBBER (talk | contribs)   20:53, 16 March 2009

This fixes the buggage on Safari 3.x release for me... it's not presenting <video> as an option anymore, but this should be safe -- Java is always present on Mac, and QuickTime or other plugin ought to show up on Windows if Java isn't functional.

Status & tagging log