"use client"; import { forwardRef, useImperativeHandle, useState } from "react"; export type OdyseePlayerHandle = { seekTo: (seconds: number, unit?: "seconds") => void; }; type Props = { videoId: string; startSeconds?: number; }; // Odysee's iframe embed — reloading with a new `t` query param is our only // way to seek from the outside (no JS API, no currentTime tracking). const OdyseePlayer = forwardRef(function OdyseePlayer( { videoId, startSeconds = 0 }, ref, ) { const [start, setStart] = useState(() => Math.max(0, Math.floor(startSeconds)), ); useImperativeHandle( ref, () => ({ seekTo(seconds: number) { setStart(Math.max(0, Math.floor(seconds))); }, }), [], ); const src = `https://odysee.com/%24/embed/${encodeURIComponent(videoId)}?t=${start}`; return (