a11y-player
Version:
An accessible DAISY format audiobook player for React applications
34 lines (33 loc) • 1.07 kB
TypeScript
import { default as React } from 'react';
export interface DaisyPlayerRef {
getCurrentTime(): number;
getDuration(): number;
isPlaying(): boolean;
getCurrentBookmark(): string;
getPlaybackRate(): number;
togglePlayPause(): void;
seek(bookmark: string): void;
}
export type ComponentProps = {
dirUrl: string;
appUrl: string;
pathPrefix?: string;
initialBookmark?: string;
className?: string;
language?: string;
onTimeUpdate?: (currentTime: number, bookmark: string, isPlaying: boolean) => void;
timeUpdateInterval?: number;
onBookmarkChange?: (bookmark: string) => void;
onPlaybackStateChange?: (state: {
currentTime: number;
duration: number;
isPlaying: boolean;
currentBookmark: string;
playbackRate: number;
}) => void;
onPlay?: () => void;
onPause?: () => void;
onSeek?: (bookmark: string) => void;
};
declare const DaisyPlayer: React.ForwardRefExoticComponent<ComponentProps & React.RefAttributes<DaisyPlayerRef>>;
export default DaisyPlayer;