为什么苹果手机点击上传视频按钮没反应?
chooseAndUploadVideo: function () {
const that = this;
wx.chooseMedia({
mediaType: ['video'],
sourceType: ['camera', 'album'],
maxDuration: 180,
camera: 'back',
success: (res) => {
const videoPath = res.tempFiles[0].tempFilePath;
that.uploadVideoToCloud(videoPath);
},
});
},
uploadVideoToCloud: function (videoPath) {
const cloudPath = 'GeXingVideos/' + Date.now() + '.mp4';
wx.cloud.uploadFile({
cloudPath: cloudPath,
filePath: videoPath,
success: res => {
const fileID = res.fileID;
// 获取文件下载地址
wx.cloud.getTempFileURL({
fileList: [fileID],
success: urlRes => {
const videoUrl = urlRes.fileList[0].tempFileURL;
// 将视频链接设置到输入框对应的变量中
this.setData({
video_backgroundVid: videoUrl,
});
},
fail: err => {
wx.showToast({
title: '获取链接失败',
icon: 'none',
});
}
});
},
fail: err => {
wx.showToast({
title: '上传失败',
icon: 'none',
});
},
});
},