@primer/react-brand
Version:
Primer Brand is a GitHub's design system for creating React-based marketing websites and digital experiences.
37 lines (36 loc) • 1.24 kB
TypeScript
import React, { type SetStateAction, type RefObject } from 'react';
type VideoState = {
ref?: RefObject<HTMLVideoElement>;
isPlaying: boolean;
isMuted: boolean;
volume: number;
volumeBeforeMute: number | null;
ccEnabled: boolean;
duration: number;
};
export type UseVideoContext = VideoState & {
play: () => void;
pause: () => void;
togglePlaying: () => void;
mute: () => void;
unmute: () => void;
toggleMute: () => void;
setVolume: (volumeValOrFn: SetStateAction<number>) => void;
seekToPercent: (percent: number) => void;
seek: (secondsValOrFn: SetStateAction<number>) => void;
enableCC: () => void;
disableCC: () => void;
toggleCC: () => void;
enterFullScreen: () => void;
exitFullScreen: () => void;
toggleFullScreen: () => void;
setDuration: (duration: number) => void;
isFullScreen: boolean;
fullscreenRef: RefObject<HTMLDivElement>;
};
export declare const VideoContext: React.Context<UseVideoContext | null>;
export declare const useVideo: () => UseVideoContext;
export declare const VideoProvider: React.ForwardRefExoticComponent<{
children?: React.ReactNode | undefined;
} & React.RefAttributes<HTMLVideoElement>>;
export {};