feat: generate video thumbnails using poster attribute (#73)

This commit is contained in:
2026-04-03 21:46:41 +05:30
parent 80df16f97b
commit 179ffb9897
+5 -1
View File
@@ -42,7 +42,11 @@
<Link {external} {href} class="my-2 block">
<div class="overflow-hidden rounded-box">
{#if url.match(/\.(mov|webm|mp4)$/) || VIDEO_CONTENT_TYPES.includes(fileType)}
<video controls src={url} class="max-h-96 rounded-box object-contain object-center">
<video
controls
src={url}
poster="{url}#t=0.1"
class="max-h-96 rounded-box object-contain object-center">
<track kind="captions" />
</video>
{:else if url.match(/\.(jpe?g|png|gif|webp)$/) || IMAGE_CONTENT_TYPES.includes(fileType)}