evt.stopPropagation()}
+ onPointerEnter={onHoverWithTimeout}
+ onPointerMove={onHoverWithTimeout}
+ onPointerLeave={onEndHoverWithTimeout}
+ onPointerDown={onPointerDown}>
+ {/* Empty space - click to play/pause */}
+
+ {/* Time indicator when controls are hidden */}
+ {!showControls && !focused && duration > 0 && (
+
+ {formatTime(Math.floor(duration - currentTime))}
+
+ )}
+ {/* Controls bar */}
+
+
+
+
:
}
+ onPress={() => {
+ setFocused(true)
+ togglePlayPause()
+ }}
+ />
+
+ {Math.round(duration) > 0 && (
+
+ {formatTime(currentTime)} / {formatTime(duration)}
+
+ )}
+
+
:
}
+ onPress={() => {
+ setFocused(true)
+ toggleFullscreen()
+ }}
+ />
+
+
+ {/* Spinner / Error overlay */}
+ {(showSpinner || error) && (
+
+ {showSpinner &&
}
+ {error && (
+
+ An error occurred
+
+ )}
+
+ )}
+
+ )
+}
+
+// --- Main VideoPlayer component (lazy-loaded) ---
+
+export default function VideoPlayer({
+ content,
+}: {
+ content: AppBskyEmbedVideo.View
+}) {
+ const containerRef = useRef