import { useCallback, useRef, useState } from "react"; import { CSSTransition } from "react-transition-group"; import { BackdropControl } from "./controls/BackdropControl"; import { FullscreenControl } from "./controls/FullscreenControl"; import { LoadingControl } from "./controls/LoadingControl"; import { MiddlePauseControl } from "./controls/MiddlePauseControl"; import { PauseControl } from "./controls/PauseControl"; import { ProgressControl } from "./controls/ProgressControl"; import { TimeControl } from "./controls/TimeControl"; import { VolumeControl } from "./controls/VolumeControl"; import { VideoPlayerHeader } from "./parts/VideoPlayerHeader"; import { useVideoPlayerState } from "./VideoContext"; import { VideoPlayer, VideoPlayerProps } from "./VideoPlayer"; interface DecoratedVideoPlayerProps { title?: string; onGoBack?: () => void; } function LeftSideControls() { const { videoState } = useVideoPlayerState(); const handleMouseEnter = useCallback(() => { videoState.setLeftControlsHover(true); }, [videoState]); const handleMouseLeave = useCallback(() => { videoState.setLeftControlsHover(false); }, [videoState]); return (
); } export function DecoratedVideoPlayer( props: VideoPlayerProps & DecoratedVideoPlayerProps ) { const top = useRef(null); const bottom = useRef(null); const [show, setShow] = useState(false); const onBackdropChange = useCallback( (showing: boolean) => { setShow(showing); }, [setShow] ); return (
{props.children} ); }