上传视频

newyslclassrooms
caicai8 5 years ago
parent 07124d2124
commit 75885fa880

@ -301,11 +301,11 @@ class VideoIndex extends Component{
<span>
{
videoId ?
<WordsBtn style="blue" onClick={()=>this.editDir(videoData && videoData.category_name,videoId)} className={"mr30 font-16"}>目录重命名</WordsBtn>
<WordsBtn style="blue" onClick={()=>this.editDir(videoData && videoData.category_name,videoId)} className={"ml30 font-16"}>目录重命名</WordsBtn>
:
<WordsBtn style="blue" className="mr30 font-16" onClick={this.addDir}>新建目录</WordsBtn>
<WordsBtn style="blue" className="ml30 font-16" onClick={this.addDir}>新建目录</WordsBtn>
}
<WordsBtn style="blue" className="mr30 font-16" onClick={()=>this.setLinkeVisible(true)}>增加外链</WordsBtn>
<WordsBtn style="blue" className="ml30 font-16" onClick={()=>this.setLinkeVisible(true)}>增加外链</WordsBtn>
</span>:""
}
{
@ -313,9 +313,9 @@ class VideoIndex extends Component{
<span>
{
upload ?
<WordsBtn style="grey" className="font-16" onClick={()=>this.uploadVideo(false)}>取消</WordsBtn>
<WordsBtn style="grey" className="font-16 ml30" onClick={()=>this.uploadVideo(false)}>取消</WordsBtn>
:
<WordsBtn style="blue" className="font-16" onClick={this.toUpload}>上传视频</WordsBtn>
<WordsBtn style="blue" className="font-16 ml30" onClick={this.toUpload}>上传视频</WordsBtn>
}
</span>:""
}

@ -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)
}
}

@ -168,15 +168,15 @@ function VideoUploadList (props) {
},
onUploadEnd: (uploadInfo) => {
console.log('onUploadEnd', uploadInfo)
setLoading(false);
},
onUploadSucceed: (uploadInfo) => {
console.log('onUploadSucceed', uploadInfo)
setLoading(false);
},
onUploadError: (uploadInfo) => {
setLoading(false);
},
// 可能需要等lib加载完毕才能执行
gotUploader: (_uploader) => {
@ -187,7 +187,7 @@ function VideoUploadList (props) {
window.uploader = uploader;
}
},setLoading
}
// )
)
} else {

Loading…
Cancel
Save