* allow for resampling ogg videos in the advanced encoder
authorMichael Dale <dale@users.mediawiki.org>
Thu, 1 Oct 2009 19:17:35 +0000 (19:17 +0000)
committerMichael Dale <dale@users.mediawiki.org>
Thu, 1 Oct 2009 19:17:35 +0000 (19:17 +0000)
* dialog display size updates when video clips

js2/mwEmbed/libAddMedia/mvAdvFirefogg.js
js2/mwEmbed/libAddMedia/mvFirefogg.js
js2/mwEmbed/mv_embed.js

index c566815..f4f7715 100644 (file)
@@ -716,6 +716,12 @@ default_local_settings:{
                var _this = this;
                //do the base encoder settings setup:
                this.basefogg_autoEncoderSettings();
+               
+               //special case see if we already have ogg video in adv encoder expose encode settings anyway: 
+               if( _this.isOggFormat() ){
+                       _this.encoder_settings['passthrough'] = false;
+               }
+               
                //make sure we are "encoding" if not display not a video file eror:
                if( this.encoder_settings['passthrough'] ){
                        js_log("in passthrough mode (hide control)");
index c886c61..b341ca6 100644 (file)
@@ -379,10 +379,12 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface
                function getFrame() {
                        var v = $j('#fogg_preview_vid').get(0);
                        var canvas = $j('#fogg_preview_canvas').get(0);
-                       canvas.width = 160;
-                       canvas.height = canvas.width * v.videoHeight/v.videoWidth;
-                       var ctx = canvas.getContext("2d");
-                       ctx.drawImage(v, 0, 0, canvas.width, canvas.height);
+                       if( canvas ){
+                               canvas.width = 160;
+                               canvas.height = canvas.width * v.videoHeight/v.videoWidth;
+                               var ctx = canvas.getContext("2d");
+                               ctx.drawImage(v, 0, 0, canvas.width, canvas.height);
+                       }
                }               
                var previewI=null;
                function preview() {                            
@@ -695,16 +697,31 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface
                                function resizeVid(){
                                        var v = $j('#fogg_final_vid').get(0);                                   
                                        if( v.videoWidth > 720 ){
-                                               $j(v).css({
-                                                       'width':720,
-                                                       'height': 720 * (v.videoHeight/v.videoWidth)                                                    
-                                               });
+                                               var vW = 720;
+                                               var vH = 720 * (v.videoHeight/v.videoWidth)                                                                                                     
                                        }else{
-                                               $j(v).css({
-                                                       'width': v.videoWidth,
-                                                       'height': v.videoHeight                                                 
+                                               var vW = v.videoWidth;
+                                               var vH = v.videoHeight;                                                                                         
+                                       }
+                                       //reize the video:
+                                       $j(v).css({
+                                               'width' : vW,
+                                               'height': vH                                    
+                                       });
+                                       //if large video resize the dialog box:
+                                       if( vW > 400){ 
+                                               //also resize the dialog box
+                                               $j('#upProgressDialog').parent().animate({
+                                                       'width':  vW + 5,
+                                                       'height' : vH + 30
                                                });
-                                       }                                       
+                                               
+                                               //also position the parent container                            
+                                               $j('#upProgressDialog').parent().animate({
+                                                       'left': ($j(document).width() - (vW + 5) )/2 ,
+                                                       'top':  ($j(document).height() - (vH + 30) )/2                                          
+                                               });
+                                       }
                                }
                                
                                //set flag to diplay video at res 
index 7b56464..556d081 100644 (file)
@@ -88,7 +88,7 @@ if( !mv_embed_path ) {
        var mv_embed_path = getMvEmbedPath();
 }
 
-// Init the global message table if it has not been initialised already
+// Init the global message table if it has not been initialized already
 if( !gMsg ) {
        var gMsg = {};
 }