From 377bebfb88ce289bae8bf3ad1e3b2e1e475cfe31 Mon Sep 17 00:00:00 2001 From: boutmoun123 Date: Tue, 26 May 2026 17:27:17 +0300 Subject: [PATCH] Update media Postman collections and dashboard playback --- .gitignore | 1 + .../dashboard/post-preview-card.tsx | 23 +++++-- ...a-Auth-Users-Posts.postman_collection.json | 63 +++++++++++++++++++ .../Oudelaa-Dashboard.postman_collection.json | 36 ++++++++++- .../Oudelaa-Mobile.postman_collection.json | 63 +++++++++++++++++++ 5 files changed, 181 insertions(+), 5 deletions(-) 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 }) {