使用vod上传
上传普通格式的视频没有问题 在上传苹果手机上的 延时摄影 视频之后 视频黑屏
import VODUpload from '@/js_sdk/vod-upload/aliyun-upload-sdk-1.0.0.min.js'
uni.chooseVideo({
maxDuration: 60,
count: 1,
sourceType: ['album'],
success: result => {
console.log(result)
console.log(result.tempFilePath)
console.log('chooseVideo', result)
if (!result.tempFilePath) {
this.loading = false;
return;
}
uni.getVideoInfo({
src: result.tempFilePath,
success: res => {
console.log(25 * 1024)
console.log('getVideoInfo', res)
uni.showLoading({
title: '加载中...'
});
const file = {
url: result.tempFilePath,
coverUrl: result.thumbTempFilePath || '',
fileSize: res.size
};
const userData = '{"Vod":{}}'
const uploader = this.uploader;
uploader.addFile(file, null, null, null, userData)
uploader.startUpload();
},
fail: (err) => {
this.loading = false;
uni.hideLoading();
console.log('getImageInfo error', err)
}
})
},
fail: (err) => {
console.log('chooseVideo error', err)
this.loading = false;
uni.hideLoading();
}
})
2 个回复
2***@qq.com (作者)
已解决
添加
compressed: false,
疑似 chooseVideo 压缩 ios 延时摄影视频 时出现问题
tutututu
你好,我也遇到了类似的问题,请问代码里的const uploader = this.uploader这个this.uploader是怎么获得的呢?我运行时提示“Cannot read properties of undefined (reading 'addFile')”。请问可以贴一下你的完整代码吗,求指导,谢谢