react-use-audio-player-guru
Version:
React hook for building custom audio playback controls
17 lines (16 loc) • 677 B
TypeScript
import { Howl } from "howler";
import { AudioPlayerContext, AudioOptions } from "./types";
declare const noop: () => void;
export declare type AudioPlayerControls = Omit<AudioPlayerContext, "player"> & {
play: Howl["play"] | typeof noop;
pause: Howl["pause"] | typeof noop;
stop: Howl["stop"] | typeof noop;
mute: Howl["mute"] | typeof noop;
volume: Howl["volume"] | typeof noop;
seek: (position?: number) => number | undefined;
togglePlayPause: () => void;
rate: Howl["rate"] | typeof noop;
player: Howl | null;
};
export declare const useAudioPlayer: (options?: AudioOptions | undefined) => AudioPlayerControls;
export {};