add support for video previews (#197)

* add support for video previews

* fix two cases where video previews did not show
This commit is contained in:
Kevin Lewis
2025-08-14 22:12:13 -04:00
committed by GitHub
parent c96a164f68
commit 71a200ed5c
13 changed files with 267 additions and 120 deletions

View File

@@ -20,7 +20,10 @@
>
<div class="flex gap-4 overflow-hidden whitespace-nowrap">
<div class="h-18 preview-aspect">
<img :src="item.preview" />
<div v-if="isVideoUrl(item.preview)" class="h-full w-full">
<PreviewVideo :src="item.preview" />
</div>
<img v-else :src="item.preview" />
</div>
<div class="flex flex-1 flex-col gap-3 overflow-hidden">
@@ -72,11 +75,13 @@
<script setup lang="ts">
import DialogCreateTask from 'components/DialogCreateTask.vue'
import PreviewVideo from 'components/PreviewVideo.vue'
import ResponseScroll from 'components/ResponseScroll.vue'
import { useContainerQueries } from 'hooks/container'
import { useDialog } from 'hooks/dialog'
import { useDownload } from 'hooks/download'
import Button from 'primevue/button'
import { isVideoUrl } from 'utils/media'
import { ref } from 'vue'
import { useI18n } from 'vue-i18n'