r52851 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52850‎ | r52851 | r52852 >
Date:18:10, 7 July 2009
Author:dale
Status:deferred
Tags:
Comment:
native warning check update
Modified paths:
  • /branches/new-upload/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js (modified) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/skins/mvpcf/styles.css (modified) (history)

Diff [purge]

Index: branches/new-upload/phase3/js2/mwEmbed/skins/mvpcf/styles.css
@@ -784,5 +784,6 @@
785785 cursor : pointer;
786786 width:10px;
787787 height:10px;
788 - margin-left:3px;
 788+ position:absolute;
 789+ left:-1px;
789790 }
\ No newline at end of file
Index: branches/new-upload/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js
@@ -325,26 +325,8 @@
326326 $j('#' + embedObj.id).get(0).play();
327327 });
328328
329 - //add recomend firefox if non-native playback:
330 - var doGetNativeWarning = true;
331 - if( $j.cookie('dismissNativeWarn') && $j.cookie('dismissNativeWarn')===true){
332 - doGetNativeWarning = false;
333 - }else{
334 - for(var i in embedObj.media_players){
335 - if(embedObj.media_players[i].id == 'videoElement'){
336 - doGetNativeWarning=false;
337 - }
338 - }
339 - var playable_sources = embedObj.media_element.getPlayableSources();
340 - for(var source=0; source <playable_sources.length; source++){
341 - var mime_type = playable_sources[source].mime_type;
342 - if( mime_type=='video/h264' || mime_type=='video/x-flv'){
343 - //they have flash / h.264 fallback no need to push firefox :(
344 - doGetNativeWarning = false;
345 - }
346 - }
347 - }
348 - if( doGetNativeWarning ){
 329+ //add recomend firefox if non-native playback:
 330+ if( embedObj.doNativeWarningCheck() ){
349331 $j('#dc_'+ embedObj.id).hover(
350332 function(){
351333 if($j('gnp_' + embedObj.id).length==0){
@@ -1283,6 +1265,29 @@
12841266 this.inheritEmbedObj();
12851267 }
12861268 },
 1269+ doNativeWarningCheck:function(){
 1270+ if( $j.cookie('dismissNativeWarn') && $j.cookie('dismissNativeWarn')===true){
 1271+ return false;
 1272+ }else{
 1273+ //see if we have native support for ogg:
 1274+ var supporting_players = embedTypes.players.getMIMETypePlayers( 'video/ogg' );
 1275+ for(var i=0; i < supporting_players.length; i++){
 1276+ if(supporting_players[i].id == 'videoElement'){
 1277+ return false;
 1278+ }
 1279+ }
 1280+ //see if we are using a fallback (in which case it does not matter)
 1281+ var playable_sources = this.media_element.getPlayableSources();
 1282+ for(var source=0; source <playable_sources.length; source++){
 1283+ var mime_type = playable_sources[source].mime_type;
 1284+ if( mime_type=='video/h264' || mime_type=='video/x-flv'){
 1285+ //they have flash / h.264 fallback no need to push firefox :(
 1286+ return false;
 1287+ }
 1288+ }
 1289+ }
 1290+ return true;
 1291+ },
12871292 getTimeReq:function(){
12881293 //js_log('f:getTimeReq:'+ this.getDurationNTP());
12891294 var default_time_req = '0:00:00/' + this.getDurationNTP() ;

Status & tagging log