rooks
Version:
Collection of awesome react hooks
26 lines (25 loc) • 705 B
TypeScript
/**
* useVideo
* @description Video hook for react
* @see {@link https://rooks.vercel.app/docs/hooks/useVideo}
*/
import { RefObject } from "react";
type VideoState = {
currentTime: number;
duration: number;
isPaused: boolean;
isMuted: boolean;
volume: number;
};
type VideoControls = {
play: () => void;
pause: () => void;
toggleMute: () => void;
setVolume: (volume: number) => void;
setCurrentTime: (time: number) => void;
fastForward: (seconds: number) => void;
rewind: (seconds: number) => void;
toggleFullScreen: () => void;
};
declare const useVideo: () => [RefObject<HTMLVideoElement | null>, VideoState, VideoControls];
export { useVideo };