From 4b80e89973960907915dedddbd73fd2dd4578261 Mon Sep 17 00:00:00 2001 From: du <13220750630.163.com> Date: 星期二, 01 四月 2025 14:30:06 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- easegen-front/src/views/digitalcourse/digitalhumans/DigitalHumansForm.vue | 6 +++++- easegen-front/src/components/DiyEditor/components/mobile/VideoPlayer_mov/index.vue | 38 ++++++++++++++++++++++---------------- easegen-front/src/views/digitalcourse/digitalhumans/AuditForm.vue | 10 +++++++++- 3 files changed, 36 insertions(+), 18 deletions(-) diff --git a/easegen-front/src/components/DiyEditor/components/mobile/VideoPlayer_mov/index.vue b/easegen-front/src/components/DiyEditor/components/mobile/VideoPlayer_mov/index.vue index 0adf76d..712c648 100644 --- a/easegen-front/src/components/DiyEditor/components/mobile/VideoPlayer_mov/index.vue +++ b/easegen-front/src/components/DiyEditor/components/mobile/VideoPlayer_mov/index.vue @@ -1,46 +1,52 @@ <!-- 閽堝mov瑙嗛鐨勮棰戝鐞� --> <template> - <div class="w-full" :style="{ height: `${property.style.height}px` }"> - <el-image class="w-full w-full" :src="property.posterUrl" v-if="property.posterUrl" /> + <div class="w-full" :style="{ height: `${property.style.height}px` }" v-loading="VideoUrl===''" > <!-- :src="TakeUrl('/public/mov/processed_video.mov')" --> <video :style="{ height: `${property.style.height}px` }" - v-else class="w-full w-full" - :src=" TakeUrl(property.videoUrl) " :poster="property.posterUrl" :autoplay="property.autoplay" + :src="VideoUrl" controls ref="videoRef" ></video> </div> </template> <script setup lang="ts"> -import { ref } from "vue"; +import { ref, onMounted } from 'vue' import { VideoPlayerProperty } from './config' -import { MoveToMp4 } from "@/utils/MovToMp4" +import { MoveToMp4 } from '@/utils/MovToMp4' const videoRef = ref() + +const isLoading = ref(true) + +// 褰撳墠瑙嗛鐨勮棰戝湴鍧� +const VideoUrl = ref("") /** 瑙嗛鎾斁 */ defineOptions({ name: 'VideoPlayer' }) -defineProps<{ property: VideoPlayerProperty }>() +const Url = defineProps<{ property: VideoPlayerProperty }>() // 瑙嗛鏂囦欢鍦板潃澶勭悊 -const TakeUrl = async (url:string) => { - let fileType = String( url.slice( url.lastIndexOf(".")+1 ) ) - if( fileType === 'mov' ){ - let file = await MoveToMp4( url ) - videoRef.value.src = file - }else{ - videoRef.value.src = url - } - +const TakeUrl = async () => { + const url = Url.property.videoUrl + let fileType = String(url.slice(url.lastIndexOf('.') + 1)) + if (fileType === 'mov') { + let file = await MoveToMp4(url) + VideoUrl.value = file + } else { + VideoUrl.value = url + } } +onMounted( ()=>{ + TakeUrl() +} ) </script> diff --git a/easegen-front/src/views/digitalcourse/digitalhumans/AuditForm.vue b/easegen-front/src/views/digitalcourse/digitalhumans/AuditForm.vue index 5ca2596..aced70f 100644 --- a/easegen-front/src/views/digitalcourse/digitalhumans/AuditForm.vue +++ b/easegen-front/src/views/digitalcourse/digitalhumans/AuditForm.vue @@ -19,7 +19,15 @@ <el-form-item v-if="formData.useModel == 2 || formData.useModel == 3" :label="t('digitalhumans.video')" prop="videoUrl"> <UploadFile v-if="!(formData.videoUrl || formData.fixVideoUrl)" v-model="formData.videoUrl" :fileType="['mp4']" :limit="1" @on-success="handleFileSuccess('fixVideoUrl', $event)"/> - <video-player v-if="formData.videoUrl || formData.fixVideoUrl" :property="videoProperty"/> + + + <!-- 鎾斁mov瑙嗛 --> + <!-- 涓嬮潰鐨勬槸鍘熸湰鐨� --> + <!-- <video-player v-if="formData.videoUrl || formData.fixVideoUrl" :property="videoProperty"/> --> + <!-- 涓嬮潰鐨勬槸閽堝mov鏂板姞鐨� --> + <VideoPlayerMov v-if="formData.videoUrl || formData.fixVideoUrl" :property="videoProperty"/> + + </el-form-item> <el-form-item :label="t('digitalhumans.type')" prop="type"> <el-select disabled v-model="formData.type" :placeholder="t('common.selectText') + t('digitalhumans.type')"> diff --git a/easegen-front/src/views/digitalcourse/digitalhumans/DigitalHumansForm.vue b/easegen-front/src/views/digitalcourse/digitalhumans/DigitalHumansForm.vue index 49f7c2e..848ea7d 100644 --- a/easegen-front/src/views/digitalcourse/digitalhumans/DigitalHumansForm.vue +++ b/easegen-front/src/views/digitalcourse/digitalhumans/DigitalHumansForm.vue @@ -54,7 +54,10 @@ 褰撳墠姝e湪澶勭悊骞朵笂浼犱腑锛岃鑰愬績绛夊緟... </div> </div> --> - <video-player v-if="formData.videoUrl || formData.fixVideoUrl" :property="videoProperty"/> + <!-- 鍘熻棰戞挱鏀惧櫒 --> + <!-- <video-player v-if="formData.videoUrl || formData.fixVideoUrl" :property="videoProperty"/> --> + <!-- 鏂扮殑瑙嗛鎾斁鍣� --> + <VideoPlayerMov v-if="formData.videoUrl || formData.fixVideoUrl" :property="videoProperty"/> </el-form-item> <!-- <el-form-item :label="鎶犲浘鏍囪瘑" prop="matting"> <el-select v-model="formData.matting" :placeholder="璇烽�夋嫨鎶犲浘鏍囪瘑"> @@ -97,6 +100,7 @@ import { getIntDictOptions, DICT_TYPE } from '@/utils/dict' import * as DigitalHumansApi from '@/api/digitalcourse/digitalhumans' import VideoPlayer from "@/components/DiyEditor/components/mobile/VideoPlayer/index.vue"; +import VideoPlayerMov from "@/components/DiyEditor/components/mobile/VideoPlayer_mov/index.vue"; import {DiyComponent} from "@/components/DiyEditor/util"; import {VideoPlayerProperty} from "@/components/DiyEditor/components/mobile/VideoPlayer/config"; import { useUpload } from '@/components/UploadFile/src/useUpload' -- Gitblit v1.9.3