Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

feat: add supports for preview audio and video file in attachment detail #841

Merged
merged 4 commits into from
Feb 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,20 @@ const onVisibleChange = (visible: boolean) => {
</template>
</LazyImage>
</div>
<div v-else-if="attachment?.spec.mediaType?.startsWith('video/')">
<video
:src="attachment.status?.permalink"
controls
class="max-w-full rounded sm:max-w-[50%]"
>
当前浏览器不支持该视频播放
</video>
</div>
<div v-else-if="attachment?.spec.mediaType?.startsWith('audio/')">
<audio :src="attachment.status?.permalink" controls>
当前浏览器不支持该音频播放
</audio>
</div>
<span v-else> 此文件不支持预览 </span>
</dd>
</div>
Expand Down