var bObj = {};
bObj[ gM('mwe-return-to-form') ] = function(){
_this.form_post_override = false;
- $j(this).dialog('close');
+ $j(this).empty().dialog('close');
};
//@@TODO should be refactored to more specialUpload page type error handling
$j( _this.editForm ).submit();
};
bObj[ gM('mwe-return-to-form') ] = function(){
- $j(this).dialog('close');
+ $j(this).empty().dialog('close');
_this.form_post_override = false;
}
_this.updateProgressWin( gM('mwe-uploadwarning'), '<h3>' + gM('mwe-uploadwarning') + '</h3>' +wmsg + '<p>',bObj);
if( _this.done_upload_cb && typeof _this.done_upload_cb == 'function'){
js_log("call done_upload_cb");
//close up shop:
- $j('#upProgressDialog').dialog('close');
+ $j('#upProgressDialog').empty().dialog('close');
//call the callback:
_this.done_upload_cb( apiRes.upload );
return false;
}else{
var bObj = {};
bObj[ gM('mwe-return-to-form')] = function(){
- $j(this).dialog('close');
+ $j(this).empty().dialog('close');
_this.form_post_override = false;
}
bObj[ gM('mwe-go-to-resource') ] = function(){
if(buttons){
$j('#upProgressDialog').dialog('option','buttons', buttons);
}else{
- //@@todo should convice the jquery ui people to not use object keys as user msg's
+ //@@todo should fix jquery ui to not use object keys as user msg's
var bObj = {};
bObj[ gM('mwe-ok-button') ] = function(){
- $j(this).dialog('close');
+ $j(this).empty().dialog('close');
};
$j('#upProgressDialog').dialog('option','buttons', bObj);
}
//confirm:
if( confirm( gM('mwe-cancel-confim') )){
//@@todo (cancel the encode / upload)
- $j(this).dialog('close');
+ $j(this).empty().dialog('close');
return false;
}else{
return true;
"fogg-transcoding" : "Encoding video to Ogg",
"fogg-encoding-done" : "Encoding complete",
"fogg-badtoken" : "Token is not valid",
- "fogg-preview" : "Preview Video",
- "fogg-hidepreview" : "Hide Preview"
+ "fogg-preview" : "Preview video",
+ "fogg-hidepreview" : "Hide preview"
});
var firefogg_install_links = {
//do firefogg specific additions:
dispProgressOverlay:function(){
this.pe_dispProgressOverlay();
- this.doPreviewControl();
+ //if we are uploading video (not in passthrough mode show preview button)
+ if( ! this.encoder_settings['passthrough'] ){
+ this.doPreviewControl();
+ }
},
doPreviewControl:function(){
var _this = this;
$j('#fogg_preview_canvas').hide('slow');
}
+ //don't follow the #
+ return false;
});
},
doRenderPreview:function(){
//set up the hidden video to pull frames from:
if( $j('#fogg_preview_vid').length == 0 )
$j('body').append('<video id="fogg_preview_vid" style="display:none"></video>');
- var v = $j('#fogg_preview_vid').get(0);
-
+ var v = $j('#fogg_preview_vid').get(0);
function seekToEnd(){
var v = $j('#fogg_preview_vid').get(0);
_this.autoEncoderSettings();
//if set to passthough update the interface:
- if(_this.encoder_settings['passthrough']==true){
+ if(_this.encoder_settings['passthrough'] == true){
$j(_this.target_passthrough_mode).show();
}else{
$j(_this.target_passthrough_mode).hide();
//update upload status:
_this.doUploadStatus();
}else{
- js_log("done with encoding (no upload) ");
+ js_log("done with encoding (no upload) ");
//set stuats to 100% for one second:
- _this.updateProgress( 1 );
+ _this.updateProgress( 1 );
setTimeout(function(){
- _this.updateProgressWin(gM('fogg-encoding-done'), gM('fogg-encoding-done'));
+ _this.updateProgressWin(gM('fogg-encoding-done'),
+ gM('fogg-encoding-done') + '<br>' +
+ //show the video at full resolution upto 720px wide
+ '<video controls="true" style="margin:auto" id="fogg_final_vid" src="' +
+ _this.fogg.previewUrl + '"></video>'
+ );
+ //load the video and set a callback:
+ var v = $j('#fogg_final_vid').get(0);
+ 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)
+ });
+ }else{
+ $j(v).css({
+ 'width': v.videoWidth,
+ 'height': v.videoHeight
+ });
+ }
+ }
+
+ //set flag to diplay video at res
+ v.removeEventListener("loadedmetadata", resizeVid, true);
+ v.addEventListener("loadedmetadata", resizeVid, true);
+ v.load();
+
}, 1000);
}
},
}else{
//if done action returns 'false' //close progress window
this.action_done = true;
- $j('#upProgressDialog').dialog('close');
+ $j('#upProgressDialog').empty().dialog('close');
}
}else{
//update status (without done_upload_cb)
}else{
this.action_done = true;
this.fogg.cancel();
- $j(dlElm).dialog('close');
+ $j(dlElm).empty().dialog('close');
}
} else{
return false;