2023-01-08 22:29:38 +01:00
|
|
|
import { BackdropControl } from "./controls/BackdropControl";
|
|
|
|
import { FullscreenControl } from "./controls/FullscreenControl";
|
|
|
|
import { LoadingControl } from "./controls/LoadingControl";
|
|
|
|
import { PauseControl } from "./controls/PauseControl";
|
|
|
|
import { ProgressControl } from "./controls/ProgressControl";
|
|
|
|
import { TimeControl } from "./controls/TimeControl";
|
|
|
|
import { VolumeControl } from "./controls/VolumeControl";
|
2023-01-10 00:27:04 +01:00
|
|
|
import { VideoPlayerHeader } from "./parts/VideoPlayerHeader";
|
2023-01-08 22:29:38 +01:00
|
|
|
import { VideoPlayer, VideoPlayerProps } from "./VideoPlayer";
|
|
|
|
|
2023-01-10 00:27:04 +01:00
|
|
|
// TODO animate items away when hidden
|
|
|
|
|
2023-01-08 22:29:38 +01:00
|
|
|
export function DecoratedVideoPlayer(props: VideoPlayerProps) {
|
|
|
|
return (
|
|
|
|
<VideoPlayer autoPlay={props.autoPlay}>
|
|
|
|
<BackdropControl>
|
2023-01-09 21:51:24 +01:00
|
|
|
<div className="absolute inset-0 flex items-center justify-center">
|
|
|
|
<LoadingControl />
|
|
|
|
</div>
|
2023-01-10 00:27:04 +01:00
|
|
|
<div className="pointer-events-auto absolute inset-x-0 bottom-0 flex flex-col px-4 pb-2">
|
2023-01-09 21:51:24 +01:00
|
|
|
<ProgressControl />
|
2023-01-10 00:27:04 +01:00
|
|
|
<div className="flex items-center px-2">
|
2023-01-09 21:51:24 +01:00
|
|
|
<PauseControl />
|
|
|
|
<VolumeControl className="mr-2" />
|
|
|
|
<TimeControl />
|
|
|
|
<div className="flex-1" />
|
|
|
|
<FullscreenControl />
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-01-10 00:27:04 +01:00
|
|
|
<div className="pointer-events-auto absolute inset-x-0 top-0 flex flex-col py-6 px-8 pb-2">
|
|
|
|
<VideoPlayerHeader title="Spiderman: Coming House" />
|
|
|
|
</div>
|
2023-01-08 22:29:38 +01:00
|
|
|
</BackdropControl>
|
|
|
|
{props.children}
|
|
|
|
</VideoPlayer>
|
|
|
|
);
|
|
|
|
}
|