import { useCallback, useEffect, useRef, useState } from "react"; import { useNavigate, useParams } from "react-router-dom"; import { ArrowLeft, Lock, Maximize, Minimize, Pause, Play, Volume1, Volume2, VolumeX } from "lucide-react"; import { AuthError } from "../utils/api/client.ts"; import Box from "../components/Box.tsx"; import { dateToTimeAgo, formatTime, stringToDate } from "../utils/utils.ts"; // Both VoDs and clips share the same on-screen shape. type MediaItem = { title: string, createdAt: string, }; type MediaPlayerProps = { /** Human-readable name for the media, e.g. "VoD" or "clip". Used in messages. */ noun: string, /** Builds the raw media stream URL for the given id. Loaded directly by the *