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

Properties

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

A custom handler for the datavailable event.

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

Type declaration

    • (ev, callback): void
    • Parameters

      • ev: BlobEvent

        the event

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

        the callback that updates internal state

          • (value): void
          • Parameters

            • value: SetStateAction<Blob[]>

            Returns void

      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 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