UNPKG

react-smart-player

Version:

A lightweight and customizable video player by Naresh Dev, built for seamless streaming with advanced controls, adaptive playback, and modern UI. Perfect for web and React applications.

75 lines (74 loc) 2.36 kB
import Hls from "hls.js"; import { Dispatch, SetStateAction } from "react"; interface VideoState { videoRef: HTMLVideoElement | null; setVideoRef: (ref: HTMLVideoElement) => void; playing: boolean | ((prevState: boolean) => boolean); setPlaying: Dispatch<SetStateAction<boolean>>; videoWrapperRef: HTMLDivElement | null; setVideoWrapperRef: (ref: HTMLDivElement) => void; isBuffering?: boolean; setIsBuffering: (isBuffering: boolean) => void; isPlaying: boolean; setIsPlaying: (isPlaying: boolean) => void; muted: boolean; setMuted: (muted: boolean) => void; volume: number; setVolume: (volume: number) => void; controls: boolean; setControls: (controls: boolean) => void; currentTime: number; setCurrentTime: (currentTime: number) => void; duration: number; setDuration: (duration: number) => void; isFullscreen: boolean; setIsFullscreen: (isFullscreen: boolean) => void; hlsInstance?: Hls; setHlsInstance: (hlsInstance: Hls) => void; qualityLevels?: Hls["levels"]; setQualityLevels: (qualityLevels: Hls["levels"]) => void; activeQuality?: string; setActiveQuality: (activeQuality: string) => void; activeSubtitle?: { lang: string; label: string; url: string; } | null; setActiveSubtitle: (subtitle: { lang: string; label: string; url: string; } | null) => void; subtitles: { lang: string; label: string; url: string; }[]; setSubtitles: (subtitles: { lang: string; label: string; url: string; }[]) => void; showIntroSkip: boolean; setShowIntroSkip: (show: boolean) => void; autoPlayNext: boolean; setAutoPlayNext: (value: boolean) => void; episodeList: { id: number; title: string; url: string; }[]; setEpisodeList: (list: { id: number; title: string; url: string; }[]) => void; currentEpisodeIndex: number; setCurrentEpisodeIndex: (index: number) => void; showCountdown: boolean; setShowCountdown: (show: boolean) => void; countdownTime: number; setCountdownTime: (time: number) => void; } export declare const useVideoStore: import("zustand").UseBoundStore<import("zustand").StoreApi<VideoState>>; export {};