初始化
$('#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下载