react-all-player
Version:
react-all-player is a simple, lightweight, accessible and customizable React media player that supports modern browsers.
23 lines (22 loc) • 991 B
TypeScript
import * as React from 'react';
import { Source } from '../../types';
import Hls from '../../types/hls.js';
import DashJS from '../../types/dashjs';
export interface PlayerProps extends React.HTMLAttributes<HTMLVideoElement> {
sources: Source[];
hlsRef?: React.MutableRefObject<Hls | null>;
dashRef?: React.MutableRefObject<DashJS.MediaPlayerClass | null>;
hlsConfig?: Hls['config'];
changeSourceUrl?: (currentSourceUrl: string, source: Source) => string;
onHlsInit?: (hls: Hls, currentSource: Source) => void;
onDashInit?: (dash: DashJS.MediaPlayerClass, currentSource: Source) => void;
onInit?: (videoEl: HTMLVideoElement) => void;
autoPlay?: boolean;
muted?: boolean;
preferQuality?: (qualities: string[]) => string;
hlsVersion?: string;
dashVersion?: string;
poster?: string;
}
declare const Player: React.ForwardRefExoticComponent<PlayerProps & React.RefAttributes<HTMLVideoElement>>;
export default Player;