| | |
| | | <FormItem label="视频"> |
| | | <video style="width: 150px;height: 150px" |
| | | controls |
| | | @loadedmetadata="getVideoDuration" |
| | | :poster="uploadVideoForm.showCoverUrl" |
| | | :autoplay="false" |
| | | id="remoteVideo" :src="uploadVideoForm.showVideoUrl" |
| | |
| | | this.detail = {} |
| | | this.auditingShow = false |
| | | }, |
| | | calculateVideoFit(width, height) { |
| | | const videoRatio = width / height; |
| | | // 规则2:竖屏视频(如9:16) |
| | | if (videoRatio < 0.8) return 'cover'; |
| | | return 'contain'; |
| | | }, |
| | | // 打开审核弹窗 |
| | | openAuditing(row) { |
| | | this.auditingShow = true |
| | |
| | | this.auditingLoading = false |
| | | }) |
| | | }, |
| | | getVideoDuration(e){ |
| | | const duration = this.$refs.healthVideoInfo.duration; |
| | | const videoWidth = this.$refs.healthVideoInfo.videoWidth; |
| | | const videoHeight = this.$refs.healthVideoInfo.videoHeight; |
| | | // 根据宽高比选择视频填充模式 |
| | | const fitType = this.calculateVideoFit(videoWidth, videoHeight) |
| | | this.uploadVideoForm.videoFit = fitType |
| | | console.log('------视频信息3------------>', videoWidth,videoHeight,fitType) |
| | | |
| | | this.uploadVideoForm.videoDuration = Math.floor(duration); |
| | | }, |
| | | // 打开编辑弹窗 |
| | | deleteHealthVideo(row) { |
| | | console.log('删除测试', row) |