r57241 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57240‎ | r57241 | r57242 >
Date:19:17, 1 October 2009
Author:dale
Status:deferred
Tags:
Comment:
* allow for resampling ogg videos in the advanced encoder
* dialog display size updates when video clips
Modified paths:
  • /trunk/phase3/js2/mwEmbed/libAddMedia/mvAdvFirefogg.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/libAddMedia/mvFirefogg.js (modified) (history)
  • /trunk/phase3/js2/mwEmbed/mv_embed.js (modified) (history)

Diff [purge]

Index: trunk/phase3/js2/mwEmbed/libAddMedia/mvAdvFirefogg.js
@@ -716,6 +716,12 @@
717717 var _this = this;
718718 //do the base encoder settings setup:
719719 this.basefogg_autoEncoderSettings();
 720+
 721+ //special case see if we already have ogg video in adv encoder expose encode settings anyway:
 722+ if( _this.isOggFormat() ){
 723+ _this.encoder_settings['passthrough'] = false;
 724+ }
 725+
720726 //make sure we are "encoding" if not display not a video file eror:
721727 if( this.encoder_settings['passthrough'] ){
722728 js_log("in passthrough mode (hide control)");
Index: trunk/phase3/js2/mwEmbed/libAddMedia/mvFirefogg.js
@@ -379,10 +379,12 @@
380380 function getFrame() {
381381 var v = $j('#fogg_preview_vid').get(0);
382382 var canvas = $j('#fogg_preview_canvas').get(0);
383 - canvas.width = 160;
384 - canvas.height = canvas.width * v.videoHeight/v.videoWidth;
385 - var ctx = canvas.getContext("2d");
386 - ctx.drawImage(v, 0, 0, canvas.width, canvas.height);
 383+ if( canvas ){
 384+ canvas.width = 160;
 385+ canvas.height = canvas.width * v.videoHeight/v.videoWidth;
 386+ var ctx = canvas.getContext("2d");
 387+ ctx.drawImage(v, 0, 0, canvas.width, canvas.height);
 388+ }
387389 }
388390 var previewI=null;
389391 function preview() {
@@ -695,16 +697,31 @@
696698 function resizeVid(){
697699 var v = $j('#fogg_final_vid').get(0);
698700 if( v.videoWidth > 720 ){
699 - $j(v).css({
700 - 'width':720,
701 - 'height': 720 * (v.videoHeight/v.videoWidth)
702 - });
 701+ var vW = 720;
 702+ var vH = 720 * (v.videoHeight/v.videoWidth)
703703 }else{
704 - $j(v).css({
705 - 'width': v.videoWidth,
706 - 'height': v.videoHeight
 704+ var vW = v.videoWidth;
 705+ var vH = v.videoHeight;
 706+ }
 707+ //reize the video:
 708+ $j(v).css({
 709+ 'width' : vW,
 710+ 'height': vH
 711+ });
 712+ //if large video resize the dialog box:
 713+ if( vW > 400){
 714+ //also resize the dialog box
 715+ $j('#upProgressDialog').parent().animate({
 716+ 'width': vW + 5,
 717+ 'height' : vH + 30
707718 });
708 - }
 719+
 720+ //also position the parent container
 721+ $j('#upProgressDialog').parent().animate({
 722+ 'left': ($j(document).width() - (vW + 5) )/2 ,
 723+ 'top': ($j(document).height() - (vH + 30) )/2
 724+ });
 725+ }
709726 }
710727
711728 //set flag to diplay video at res
Index: trunk/phase3/js2/mwEmbed/mv_embed.js
@@ -88,7 +88,7 @@
8989 var mv_embed_path = getMvEmbedPath();
9090 }
9191
92 -// Init the global message table if it has not been initialised already
 92+// Init the global message table if it has not been initialized already
9393 if( !gMsg ) {
9494 var gMsg = {};
9595 }

Status & tagging log