import { CaptionsOffIcon, CaptionsOnIcon, FullscreenEnterIcon, FullscreenExitIcon, PauseIcon, PipEnterIcon, PipExitIcon, PlayIcon, RestartIcon, SeekIcon, SpinnerIcon, VolumeHighIcon, VolumeLowIcon, VolumeOffIcon, } from '@videojs/icons/react'; import { isString } from '@videojs/utils/predicate'; import { cn } from '@videojs/utils/style'; import { type ComponentProps, forwardRef, type ReactNode } from 'react'; import { Container, usePlayer } from '@/player/context'; import { BufferingIndicator } from '@/ui/buffering-indicator'; import { CaptionsButton } from '@/ui/captions-button'; import { Controls } from '@/ui/controls'; import { FullscreenButton } from '@/ui/fullscreen-button'; import { MuteButton } from '@/ui/mute-button'; import { PiPButton } from '@/ui/pip-button'; import { PlayButton } from '@/ui/play-button'; import { PlaybackRateButton } from '@/ui/playback-rate-button'; import { Popover } from '@/ui/popover'; import { Poster } from '@/ui/poster'; import { SeekButton } from '@/ui/seek-button'; import { Slider } from '@/ui/slider'; import { Time } from '@/ui/time'; import { TimeSlider } from '@/ui/time-slider'; import { Tooltip } from '@/ui/tooltip'; import { VolumeSlider } from '@/ui/volume-slider'; import { isRenderProp } from '@/utils/use-render'; import type { BaseVideoSkinProps } from '../types'; import { ErrorDialog } from './error-dialog'; const SEEK_TIME = 10; export type VideoSkinProps = BaseVideoSkinProps; const Button = forwardRef>(function Button({ className, ...props }, ref) { return )} /> ); if (volumeUnsupported) return muteButton; return ( ); } export function VideoSkin(props: VideoSkinProps): ReactNode { const { children, className, poster, ...rest } = props; return ( {children} {poster && ( )} (
)} /> ( )} /> } /> ( )} /> } /> Seek backward {SEEK_TIME} seconds ( )} /> } /> Seek forward {SEEK_TIME} seconds
)} /> } /> ( )} /> } /> ( )} /> } />
); }