Index: branches/new-upload/phase3/js2/mwEmbed/mv_embed.js |
— | — | @@ -414,10 +414,12 @@ |
415 | 415 | //do many requests: |
416 | 416 | for(var i=0; i< loadLibs.length; i++){ |
417 | 417 | var curLib = loadLibs[i]; |
418 | | - var libLoc = mvGetClassPath(curLib); |
419 | | - // do a direct load of the file (pass along unique request id from request or mv_embed Version ) |
420 | | - var qmark = (libLoc.indexOf('?')!==true)?'?':'&'; |
421 | | - this.libs[curLib] = mv_embed_path + libLoc + qmark + 'urid='+ getMvUniqueReqId(); |
| 418 | + if(curLib){ |
| 419 | + var libLoc = mvGetClassPath(curLib); |
| 420 | + // do a direct load of the file (pass along unique request id from request or mv_embed Version ) |
| 421 | + var qmark = (libLoc.indexOf('?')!==true)?'?':'&'; |
| 422 | + this.libs[curLib] = mv_embed_path + libLoc + qmark + 'urid='+ getMvUniqueReqId(); |
| 423 | + } |
422 | 424 | } |
423 | 425 | } |
424 | 426 | } |
— | — | @@ -478,13 +480,12 @@ |
479 | 481 | callback(); |
480 | 482 | } |
481 | 483 | }); |
482 | | - } |
483 | | - }, |
| 484 | + } }, |
484 | 485 | checkLoading:function(){ |
485 | 486 | var loading=0; |
486 | 487 | var i=null; |
487 | | - for(var i in this.libs){ //for in loop oky on object |
488 | | - if( ! this.checkObjPath( i ) ){ |
| 488 | + for(var i in this.libs){ //for in loop oky on object |
| 489 | + if( !this.checkObjPath( i ) ){ |
489 | 490 | if(!this.libreq[i]){ |
490 | 491 | loadExternalJs( this.libs[i] ); |
491 | 492 | } |
— | — | @@ -497,18 +498,20 @@ |
498 | 499 | return loading; |
499 | 500 | }, |
500 | 501 | checkObjPath:function( libVar ){ |
501 | | - var objPath = libVar.split('.') |
502 | | - var cur_path =''; |
503 | | - for(var p=0; p < objPath.length; p++){ |
| 502 | + if(!libVar) |
| 503 | + return false; |
| 504 | + var objPath = libVar.split('.') |
| 505 | + var cur_path =''; |
| 506 | + for(var p=0; p < objPath.length; p++){ |
504 | 507 | cur_path = (cur_path=='')?cur_path+objPath[p]:cur_path+'.'+objPath[p]; |
505 | 508 | eval( 'var ptest = typeof ( '+ cur_path + ' ); '); |
506 | 509 | if( ptest == 'undefined'){ |
507 | 510 | this.missing_path = cur_path; |
508 | 511 | return false; |
509 | 512 | } |
510 | | - } |
511 | | - this.cur_path = cur_path; |
512 | | - return true; |
| 513 | + } |
| 514 | + this.cur_path = cur_path; |
| 515 | + return true; |
513 | 516 | }, |
514 | 517 | /** |
515 | 518 | * checks for jQuery and adds the $j noConflict var |
Index: branches/new-upload/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js |
— | — | @@ -40,7 +40,8 @@ |
41 | 41 | "mv_ogg-player-omtkplayer" : "OMTK Flash Vorbis", |
42 | 42 | "mv_generic_missing_plugin" : "You browser does not appear to support playback type: <b>$1</b><br> visit the <a href=\"http://commons.wikimedia.org/wiki/Commons:Media_help\">Playback Methods</a> page to download a player<br>", |
43 | 43 | |
44 | | - "mv_for_best_experience": "For best video playback experience we recomend <a href=\"http://www.mozilla.com/en-US/firefox/upgrade.html?from=mv_embed\">Firefox 3.5</a><br><input type=\"checkbox\">Do not warn me again." |
| 44 | + "mv_for_best_experience": "For best video playback experience we recomend <a href=\"http://www.mozilla.com/en-US/firefox/upgrade.html?from=mv_embed\">Firefox 3.5</a>", |
| 45 | + "mv_do_not_warn_again": "Do not warn me again." |
45 | 46 | |
46 | 47 | }); |
47 | 48 | |
— | — | @@ -324,30 +325,47 @@ |
325 | 326 | $j('#' + embedObj.id).get(0).play(); |
326 | 327 | }); |
327 | 328 | |
328 | | - //add recomend firefox if non-native playback: |
329 | | - var doGetFFWarning = true; |
330 | | - for(var i in embedObj.media_players){ |
331 | | - if(embedObj.media_players[i].id == 'videoElement'){ |
332 | | - doGetFFWarning=false; |
333 | | - } |
334 | | - } |
335 | | - for(var source=0; source < playable_sources.length; source++){ |
336 | | - var mime_type =playable_sources[source].mime_type; |
337 | | - if( mime_type=='video/h264' || mime_type=='video/x-flv'){ |
338 | | - //they have flash / h.264 fallback no need to push firefox :( |
339 | | - doGetFFWarning = false; |
340 | | - } |
341 | | - } |
342 | | - if(doGetFFWarning){ |
| 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 ){ |
343 | 349 | $j('#dc_'+ embedObj.id).hover( |
344 | | - function(){ |
| 350 | + function(){ |
345 | 351 | if($j('gnp_' + embedObj.id).length==0){ |
346 | 352 | $j(this).append('<div id="gnp_' + embedObj.id + '" class="ui-state-highlight ui-corner-all" ' + |
347 | 353 | 'style="position:absolute;display:none;background:#FFF;top:10px;left:10px;right:10px;height:60px;">' + |
348 | | - gM('mv_for_best_experience') + |
349 | | - '</div>'); |
| 354 | + gM('mv_for_best_experience') + |
| 355 | + '<br><input id="ffwarn_'+embedObj.id+'" type=\"checkbox\">' + |
| 356 | + gM('mv_do_not_warn_again') + |
| 357 | + '</div>'); |
| 358 | + $j('#ffwarn_'+embedObj.id).click(function(){ |
| 359 | + if( $j(this).checked ){ |
| 360 | + $j.cookie('dismissNativeWarn', true); |
| 361 | + }else{ |
| 362 | + $j.cookie('dismissNativeWarn', false); |
| 363 | + } |
| 364 | + |
| 365 | + }); |
350 | 366 | } |
351 | | - $j('#gnp_' + embedObj.id).fadeIn('slow'); |
| 367 | + if( $j.cookie('dismissNativeWarn')!== true){ |
| 368 | + $j('#gnp_' + embedObj.id).fadeIn('slow'); |
| 369 | + } |
352 | 370 | }, |
353 | 371 | function(){ |
354 | 372 | $j('#gnp_' + embedObj.id).fadeOut('slow'); |
— | — | @@ -2192,15 +2210,19 @@ |
2193 | 2211 | } |
2194 | 2212 | }, |
2195 | 2213 | toggleMute:function(){ |
2196 | | - var this_id = (this.pc!=null)?this.pc.pp.id:this.id; |
2197 | | - js_log('f:toggleMute'); |
| 2214 | + var this_id = (this.pc!=null)?this.pc.pp.id:this.id; |
2198 | 2215 | if(this.muted){ |
2199 | 2216 | this.muted=false; |
2200 | 2217 | $j('#volume_control_'+this_id + ' span').removeClass('ui-icon-volume-off').addClass('ui-icon-volume-on'); |
| 2218 | + $j('#volume_bar_'+this_id).slider('value', 100); |
| 2219 | + this.updateVolumen(1); |
2201 | 2220 | }else{ |
2202 | 2221 | this.muted=true; |
2203 | 2222 | $j('#volume_control_'+this_id + ' span').removeClass('ui-icon-volume-on').addClass('ui-icon-volume-off'); |
| 2223 | + $j('#volume_bar_'+this_id).slider('value', 0); |
| 2224 | + this.updateVolumen(0); |
2204 | 2225 | } |
| 2226 | + js_log('f:toggleMute::' + this.muted); |
2205 | 2227 | }, |
2206 | 2228 | updateVolumen:function(perc){ |
2207 | 2229 | js_log('update volume not supported with current playback type'); |
Index: branches/new-upload/phase3/js2/mwEmbed/example_usage/Player_Simple_Video_Tag.html |
— | — | @@ -3,7 +3,7 @@ |
4 | 4 | <html> |
5 | 5 | <head> |
6 | 6 | <title>Simple Video Tag Usage</title> |
7 | | - <script type="text/javascript" src="../mv_embed.js"></script> |
| 7 | + <script type="text/javascript" src="../mv_embed.js?debug=true"></script> |
8 | 8 | </head> |
9 | 9 | <body> |
10 | 10 | <h3> Simple Video Tag Usage </h3> |
Index: branches/new-upload/phase3/js2/mwEmbed/skins/mvpcf/styles.css |
— | — | @@ -784,5 +784,5 @@ |
785 | 785 | cursor : pointer; |
786 | 786 | width:10px; |
787 | 787 | height:10px; |
788 | | - margin-left:5px; |
| 788 | + margin-left:3px; |
789 | 789 | } |
\ No newline at end of file |