@bengreenier/react-user-media
    Preparing search index...

    Interface RecorderOptions

    Options for configuring the recorder. Extends MediaRecorderOptions.

    interface RecorderOptions {
        audioBitsPerSecond?: number;
        bitsPerSecond?: number;
        dataAvailableHandler?: (
            ev: BlobEvent,
            callback: (value: SetStateAction<Blob[]>) => void,
        ) => void;
        mimeType?: string;
        timeslice?: number;
        videoBitsPerSecond?: number;
    }

    Hierarchy

    • MediaRecorderOptions
      • RecorderOptions
    Index
    audioBitsPerSecond?: number
    bitsPerSecond?: number
    dataAvailableHandler?: (
        ev: BlobEvent,
        callback: (value: SetStateAction<Blob[]>) => void,
    ) => void

    A custom handler for the dataavailable event.

    Note: This is for advanced use-cases only. You probably don't need to modify the default handler.

    Type Declaration

      • (ev: BlobEvent, callback: (value: SetStateAction<Blob[]>) => void): void
      • Parameters

        • ev: BlobEvent

          the event

        • callback: (value: SetStateAction<Blob[]>) => void

          the callback that updates internal state

        Returns void

    function handleData(ev: BlobEvent, callback: (value: React.SetStateAction<Blob[]>) => void) {
    callback((current) => current.concat(ev.data));
    }
    mimeType?: string
    timeslice?: number

    The number of milliseconds to record into each Blob.

    If this parameter isn't included, the browser default behavior is used: the entire media duration is recorded into a single Blob unless the requestData() method is called to obtain the Blob and trigger the creation of a new Blob into which the media continues to be recorded.

    videoBitsPerSecond?: number