UNPKG

@jellyfish-dev/browser-media-utils

Version:

Facilitates the use of getUserMedia and enumerateDevices.

18 lines 626 B
export type UseUserMedia = { isError: boolean; stream: MediaStream | null; isLoading: boolean; start: () => void; stop: () => void; isEnabled: boolean; disable: () => void; enable: () => void; }; /** * Hook that returns media stream and methods to control it, depending on the passed method. * * @param getMedia - Promise that returns a promise with MediaStream * @returns object containing information about the media stream and methods to control it */ export declare const useMedia: (getMedia: (() => Promise<MediaStream>) | null) => UseUserMedia; //# sourceMappingURL=useMedia.d.ts.map