|
|
@ -26,7 +26,7 @@ |
|
|
<div class="material-media"> |
|
|
<div class="material-media"> |
|
|
<template v-for="(url, fileIndex) in item.itemValue" :key="fileIndex"> |
|
|
<template v-for="(url, fileIndex) in item.itemValue" :key="fileIndex"> |
|
|
<div v-if="isVideo(url)" class="media-item media-item--video" @click="onPreview(url, item.itemValue)"> |
|
|
<div v-if="isVideo(url)" class="media-item media-item--video" @click="onPreview(url, item.itemValue)"> |
|
|
<video :src="resolveMediaUrl(url)" muted preload="metadata" class="video-thumb"></video> |
|
|
<video :src="resolveMediaUrl(url)" muted preload="metadata" class="video-thumb" @loadedmetadata="onVideoLoadedMeta"></video> |
|
|
<van-icon name="play-circle-o" class="play-icon" /> |
|
|
<van-icon name="play-circle-o" class="play-icon" /> |
|
|
</div> |
|
|
</div> |
|
|
<div v-else-if="isPdf(url)" class="media-item media-item--pdf" @click="onPreview(url, item.itemValue)"> |
|
|
<div v-else-if="isPdf(url)" class="media-item media-item--pdf" @click="onPreview(url, item.itemValue)"> |
|
|
@ -226,6 +226,18 @@ const minDate = new Date() |
|
|
|
|
|
|
|
|
const resolveMediaUrl = (url) => toFullFileUrl(url) |
|
|
const resolveMediaUrl = (url) => toFullFileUrl(url) |
|
|
|
|
|
|
|
|
|
|
|
// 视频 metadata 加载后,seek 到 0.5s 跳过开头黑帧作为封面 |
|
|
|
|
|
const onVideoLoadedMeta = (e) => { |
|
|
|
|
|
const v = e.target |
|
|
|
|
|
if (!v || !isFinite(v.duration)) return |
|
|
|
|
|
const target = Math.min(0.5, v.duration / 2) |
|
|
|
|
|
try { |
|
|
|
|
|
v.currentTime = target |
|
|
|
|
|
} catch (err) { |
|
|
|
|
|
// 忽略 seek 异常 |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
const pickerDate = ref([String(minDate.getFullYear()), String(minDate.getMonth() + 1).padStart(2, '0'), String(minDate.getDate()).padStart(2, '0')]) |
|
|
const pickerDate = ref([String(minDate.getFullYear()), String(minDate.getMonth() + 1).padStart(2, '0'), String(minDate.getDate()).padStart(2, '0')]) |
|
|
|
|
|
|
|
|
const onAuditChange = (item) => { |
|
|
const onAuditChange = (item) => { |
|
|
|