|
|
@@ -1688,11 +1688,14 @@ export default {
|
|
|
this.uploadQueue.push(tempVideo);
|
|
|
this.videoList.unshift(tempVideo);
|
|
|
|
|
|
- // 获取视频时长
|
|
|
+ // 获取视频时长
|
|
|
const video = document.createElement('video');
|
|
|
video.preload = 'metadata';
|
|
|
video.onloadedmetadata = () => {
|
|
|
- tempVideo.duration = Math.round(video.duration);
|
|
|
+ const index = this.videoList.findIndex(item => item.tempId === tempVideo.tempId);
|
|
|
+ if (index !== -1) {
|
|
|
+ tempVideo.duration = Math.round(video.duration);
|
|
|
+ }
|
|
|
};
|
|
|
video.src = URL.createObjectURL(file);
|
|
|
|