diff --git a/.gitignore b/.gitignore index 3b60afa..8258388 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ node_modules dist uploads +stream_*/ # Env files .env diff --git a/oudelaa_dashboard/components/dashboard/post-preview-card.tsx b/oudelaa_dashboard/components/dashboard/post-preview-card.tsx index 77dc73e..51f6be8 100644 --- a/oudelaa_dashboard/components/dashboard/post-preview-card.tsx +++ b/oudelaa_dashboard/components/dashboard/post-preview-card.tsx @@ -30,15 +30,18 @@ export function PostPreviewCard({ post }: { post: ApiPost }) { const durationLabel = formatDuration(post.durationSeconds); const [imageFailed, setImageFailed] = useState(false); const [sourceFailed, setSourceFailed] = useState(false); + const [isVideoPlaying, setIsVideoPlaying] = useState(false); useEffect(() => { setImageFailed(false); setSourceFailed(false); + setIsVideoPlaying(false); }, [media.url, media.sourceUrl]); const showAudioPreview = media.kind === "audio" && !!media.sourceUrl && !sourceFailed; - const showVideoPreview = media.kind === "video" && !!media.sourceUrl && !sourceFailed && (!media.url || imageFailed); - const showImagePreview = !!media.url && !imageFailed; + const showVideoPreview = + media.kind === "video" && !!media.sourceUrl && !sourceFailed && (isVideoPlaying || !media.url || imageFailed); + const showImagePreview = !!media.url && !imageFailed && !(media.kind === "video" && isVideoPlaying); const showMediaShell = media.kind !== "text"; const showUnavailable = !showImagePreview && !showVideoPreview && !showAudioPreview; @@ -62,7 +65,9 @@ export function PostPreviewCard({ post }: { post: ApiPost }) {