diff --git a/src/components/PostCard.tsx b/src/components/PostCard.tsx index 6616418..fb87ac7 100644 --- a/src/components/PostCard.tsx +++ b/src/components/PostCard.tsx @@ -87,9 +87,9 @@ export function PostCard({ post, now, onToggleLike, likeBusy, likeError, onSigne {deleteError ?

Could not delete the post.

: null} {post.text ?

{post.text}

: null} {post.media.map((m, i) => - m.kind === "video" && m.hlsUrl ? ( + m.kind === "video" && (m.mp4Url || m.hlsUrl) ? (
- +
) : m.src ? (
diff --git a/src/components/VideoPlayer.tsx b/src/components/VideoPlayer.tsx index dfb5f63..8c2c73e 100644 --- a/src/components/VideoPlayer.tsx +++ b/src/components/VideoPlayer.tsx @@ -4,7 +4,8 @@ import { useEffect, useRef, useState } from "react"; import { choosePlayback, supportsNativeHls } from "@/lib/video-playback"; export interface VideoPlayerProps { - hlsUrl: string; + mp4Url?: string | null; + hlsUrl?: string | null; poster: string | null; label: string; } @@ -12,17 +13,19 @@ export interface VideoPlayerProps { const UNPLAYABLE = "Video can't be played here."; /** - * Real
); } + if (!mp4Url && !hlsUrl) { + return poster ? ( + // eslint-disable-next-line @next/next/no-img-element + Video thumbnail + ) : null; + } return (