|
|
|
@ -27,16 +27,16 @@ function loadLib(callback) {
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
function createUploader(options,setLoading) {
|
|
|
|
|
function createUploader(options) {
|
|
|
|
|
if (window.AliyunUpload && window.AliyunUpload.Vod) {
|
|
|
|
|
doCreateUploader(options,setLoading)
|
|
|
|
|
doCreateUploader(options)
|
|
|
|
|
} else {
|
|
|
|
|
loadLib(() => {
|
|
|
|
|
doCreateUploader(options,setLoading)
|
|
|
|
|
doCreateUploader(options)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function doCreateUploader (options,setLoading) {
|
|
|
|
|
function doCreateUploader (options) {
|
|
|
|
|
uploader = new window.AliyunUpload.Vod({
|
|
|
|
|
timeout: $('#timeout').val() || 60000,
|
|
|
|
|
partSize: $('#partSize').val() || 1048576,
|
|
|
|
@ -82,8 +82,7 @@ function doCreateUploader (options,setLoading) {
|
|
|
|
|
var uploadAddress = data.UploadAddress
|
|
|
|
|
var videoId = data.VideoId
|
|
|
|
|
uploader.setUploadAuthAndAddress(uploadInfo, uploadAuth, uploadAddress, videoId)
|
|
|
|
|
console.log("onUploadstarted","false");
|
|
|
|
|
setLoading && setLoading(false);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
// 删除当前出错的,并执行下一个任务
|
|
|
|
@ -181,9 +180,9 @@ function doCreateUploader (options,setLoading) {
|
|
|
|
|
options.gotUploader(uploader)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
export function getUploader (_login, options,setLoading) {
|
|
|
|
|
export function getUploader (_login, options) {
|
|
|
|
|
_login && (login = _login)
|
|
|
|
|
if (!uploader || options.create == true) {
|
|
|
|
|
createUploader(options,setLoading)
|
|
|
|
|
createUploader(options)
|
|
|
|
|
}
|
|
|
|
|
}
|