diff --git a/src/components/VideoElement.js b/src/components/VideoElement.js index f5b380a4..13426eb0 100644 --- a/src/components/VideoElement.js +++ b/src/components/VideoElement.js @@ -6,9 +6,17 @@ import './VideoElement.css' // streamUrl: string // loading: boolean -export function VideoElement({ streamUrl, loading, setProgress, videoRef }) { +// setProgress: (event: NativeEvent) => void +// videoRef: useRef +// startTime: number +export function VideoElement({ streamUrl, loading, setProgress, videoRef, startTime }) { const [error, setError] = React.useState(false); + function onLoad() { + if (startTime) + videoRef.current.currentTime = startTime; + } + React.useEffect(() => { if (!streamUrl.endsWith('.mp4')) { setError(false) @@ -40,11 +48,11 @@ export function VideoElement({ streamUrl, loading, setProgress, videoRef }) { if (!streamUrl.endsWith('.mp4')) { return ( -