From: Michael Dale Date: Thu, 1 Oct 2009 19:17:35 +0000 (+0000) Subject: * allow for resampling ogg videos in the advanced encoder X-Git-Tag: 1.31.0-rc.0~39424 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/?a=commitdiff_plain;h=6507f4090b7d646aa6bb1696e50ff6b770474b9d;p=lhc%2Fweb%2Fwiklou.git * allow for resampling ogg videos in the advanced encoder * dialog display size updates when video clips --- diff --git a/js2/mwEmbed/libAddMedia/mvAdvFirefogg.js b/js2/mwEmbed/libAddMedia/mvAdvFirefogg.js index c56681578b..f4f7715d02 100644 --- a/js2/mwEmbed/libAddMedia/mvAdvFirefogg.js +++ b/js2/mwEmbed/libAddMedia/mvAdvFirefogg.js @@ -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)"); diff --git a/js2/mwEmbed/libAddMedia/mvFirefogg.js b/js2/mwEmbed/libAddMedia/mvFirefogg.js index c886c61004..b341ca6880 100644 --- a/js2/mwEmbed/libAddMedia/mvFirefogg.js +++ b/js2/mwEmbed/libAddMedia/mvFirefogg.js @@ -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 diff --git a/js2/mwEmbed/mv_embed.js b/js2/mwEmbed/mv_embed.js index 7b564645b0..556d081c8d 100644 --- a/js2/mwEmbed/mv_embed.js +++ b/js2/mwEmbed/mv_embed.js @@ -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 = {}; }