Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/mvFirefogg.js |
— | — | @@ -111,7 +111,7 @@ |
112 | 112 | |
113 | 113 | //hide any errors warnings and video select: |
114 | 114 | $j( '#wgfogg_waring_ogg_upload,#wgfogg_waring_bad_extension,#fogg-video-file' ).hide(); |
115 | | - }, |
| 115 | + }, |
116 | 116 | select_fogg:function(){ |
117 | 117 | var _this = this; |
118 | 118 | if( _this.fogg.selectVideo() ) { |
— | — | @@ -175,6 +175,20 @@ |
176 | 176 | if( ! _this.api_url ) |
177 | 177 | return js_error( 'Error: can\'t autodetect mode without api url' ); |
178 | 178 | |
| 179 | + //extension should already be ogg but since its user editable, |
| 180 | + //check again |
| 181 | + //we are transcoding so we know it will be an ogg |
| 182 | + //(should not be done for passthrough mode) |
| 183 | + var sf = _this.formData['wpDestFile']; |
| 184 | + var ext = ''; |
| 185 | + if( sf.lastIndexOf('.') != -1){ |
| 186 | + ext = sf.substring( sf.lastIndexOf('.') ).toLowerCase(); |
| 187 | + } |
| 188 | + if ( ext != '.ogg' && ext != '.ogv' ) { |
| 189 | + var extreg = new RegExp(ext + '$', 'i'); |
| 190 | + _this.formData['wpDestFile'] = sf.replace(extreg, '.ogg'); |
| 191 | + } |
| 192 | + |
179 | 193 | //add chunk response hook to build the resultURL when uploading chunks |
180 | 194 | |
181 | 195 | //build the api url: |