react-all-player
Version:
react-all-player is a simple, lightweight, accessible and customizable React media player that supports modern browsers.
26 lines (25 loc) • 786 B
TypeScript
import React from 'react';
import Hls from '../types/hls.js';
interface VideoState {
currentTime: number;
duration: number;
ended: boolean;
paused: boolean;
volume: number;
buffering: boolean;
error: string | null;
seeking: boolean;
}
interface VideoContextProps {
videoEl: HTMLVideoElement | null;
videoState: VideoState;
setVideoState: (state: Partial<VideoState>) => void;
}
interface VideoContextProviderProps {
videoRef: React.RefObject<HTMLVideoElement>;
hlsRef: React.RefObject<Hls>;
}
export declare const VideoContext: React.Context<VideoContextProps>;
export declare const VideoContextProvider: React.FC<VideoContextProviderProps>;
export declare const useVideo: () => VideoContextProps;
export {};