adds video support

This commit is contained in:
Christian Beutel
2025-03-16 18:01:12 +01:00
parent 6cfa21c025
commit 8706fe7ac9
23 changed files with 937 additions and 97 deletions

View File

@@ -1,4 +1,5 @@
<script lang="ts">
import { isVideoURL } from "$lib/util/file_util";
import { _ } from "svelte-i18n";
interface Props {
@@ -38,6 +39,10 @@
class="group relative h-32 w-32 rounded-xl bg-cover bg-no-repeat"
style="background-image: url({src});"
>
{#if isVideoURL(src)}
<!-- svelte-ignore a11y_media_has_caption -->
<video autoplay loop class="h-32 w-32 rounded-xl object-cover" {src}></video>
{/if}
{#if isThumbnail && showThumbnailControls}
<i
class="fa fa-file-image absolute top-2 right-2 text-primary bg-white rounded-full px-[10px] py-2 shadow-lg"