fix: make work app video attachments playable
This commit is contained in:
@@ -193,18 +193,14 @@ onShow(() => {
|
||||
<view v-for="item in inboundAttachments" :key="item.file_url" class="attachment-tile">
|
||||
<view class="attachment-preview" @click="previewInboundAttachment(item)">
|
||||
<image v-if="isImageAsset(item)" class="attachment-thumb" :src="item.thumbnail_url || item.file_url" mode="aspectFill" />
|
||||
<video
|
||||
v-else-if="isVideoAsset(item)"
|
||||
class="attachment-thumb attachment-video-thumb"
|
||||
:src="item.file_url"
|
||||
:controls="false"
|
||||
:muted="true"
|
||||
:show-center-play-btn="false"
|
||||
:enable-progress-gesture="false"
|
||||
object-fit="cover"
|
||||
/>
|
||||
<template v-else-if="isVideoAsset(item)">
|
||||
<image v-if="item.thumbnail_url" class="attachment-thumb" :src="item.thumbnail_url" mode="aspectFill" />
|
||||
<view v-else class="attachment-video-thumb">
|
||||
<text class="attachment-video-label">视频</text>
|
||||
</view>
|
||||
</template>
|
||||
<view v-else class="attachment-file-thumb">附件</view>
|
||||
<view v-if="isVideoAsset(item)" class="attachment-play">▶</view>
|
||||
<view v-if="isVideoAsset(item)" class="attachment-play" @click.stop="previewInboundAttachment(item)">▶</view>
|
||||
</view>
|
||||
<view class="attachment-meta">
|
||||
<text class="attachment-name">{{ item.name || item.file_id }}</text>
|
||||
@@ -257,7 +253,7 @@ onShow(() => {
|
||||
<text class="video-preview-title">{{ activeInboundVideo.name || "入库视频" }}</text>
|
||||
<text class="video-preview-close" @click="closeInboundVideo">关闭</text>
|
||||
</view>
|
||||
<video class="video-preview-player" :src="activeInboundVideo.file_url" controls autoplay />
|
||||
<video class="video-preview-player" :src="activeInboundVideo.file_url" :poster="activeInboundVideo.thumbnail_url || ''" controls autoplay />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -347,16 +343,26 @@ onShow(() => {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.attachment-video-thumb {
|
||||
background: #202124;
|
||||
}
|
||||
|
||||
.attachment-video-thumb,
|
||||
.attachment-file-thumb {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.attachment-video-thumb {
|
||||
background: linear-gradient(135deg, #f8fafc 0%, #e8edf3 100%);
|
||||
color: var(--work-text);
|
||||
}
|
||||
|
||||
.attachment-video-label {
|
||||
font-size: 24rpx;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.attachment-file-thumb {
|
||||
color: var(--work-text-soft);
|
||||
font-size: 24rpx;
|
||||
font-weight: 800;
|
||||
|
||||
Reference in New Issue
Block a user