初始化
$('#file_upload').uploadifive({
'auto' : false,
'buttonClass':'btn',
'buttonText':'選擇視頻',
'fileSizeLimit':51200,
'fileType' : 'video/*',
'height': 25,
'whith' :120,
'uploadLimit':1,
'queueSizeLimit':1,
'queueID' : 'queue',
'uploadScript' : pathName+'/sysMarvellousVideo/uploadVideo.do',
'onUploadComplete' : function(file, data) {
console.log(data);
if(WebUtils.isNotEmpty(data)){
data = data.substring(1,data.length-1);
$("#name").val(data);
}
},
onAddQueueItem :function(file){
$("#name").val("");
$("#editUploadFile").remove();
},
onCancel : function(file) {
$("#name").val("");
/* 注意:取消后應重新設置uploadLimit */
var $data = $(this).data('uploadifive'),
settings = $data.settings;
settings.uploadLimit++;
//showMessenger(file.name + " 已取消上傳!",5,"error");
},
onFallback : function() {
showMessenger("該瀏覽器無法使用!",5,"error");
},
onError: function (errorType) {
var msg = errorType;
if(errorType=='QUEUE_LIMIT_EXCEEDED'){
msg = "最多只能選擇一個視頻!";
showMessenger(msg,5,"error");
}else if(errorType == "FILE_SIZE_LIMIT_EXCEEDED"){
msg = "視頻最大不允許超過50MB!";
showMessenger(msg,5,"error");
}
}
});
fileType:
video/* 視頻類型
audio/* 音樂類型
image/* 圖片類型
uploadiFive下載
