mediasfu-reactjs
Version:
mediasfu-reactjs – React 18/19 WebRTC SDK for video conferencing, webinars, broadcasts, live streaming, chat, recording, whiteboard, and AI agents. Plug-in prebuilt rooms or build fully custom UIs.
24 lines • 1.2 kB
TypeScript
import { RtpCapabilities, Device } from "mediasoup-client/lib/types";
export interface CreateDeviceClientOptions {
rtpCapabilities: RtpCapabilities | null;
optimizeVideoRecord?: boolean;
}
export type CreateDeviceClientType = (options: CreateDeviceClientOptions) => Promise<Device | null>;
/**
* Creates a mediasoup client device with the provided RTP capabilities.
*
* @param {CreateDeviceClientOptions} options - The options for creating the device client.
* @param {RTPCapabilities} options.rtpCapabilities - The RTP capabilities required for the device.
* @returns {Promise<Device | null>} A promise that resolves to the created Device or null if creation fails.
* @throws {Error} Throws an error if the required parameters are not provided or if device creation is not supported.
*
* @example
* const device = await createDeviceClient({ rtpCapabilities });
* if (device) {
* console.log("Device created successfully");
* } else {
* console.log("Failed to create device");
* }
*/
export declare const createDeviceClient: ({ rtpCapabilities, optimizeVideoRecord, }: CreateDeviceClientOptions) => Promise<Device | null>;
//# sourceMappingURL=createDeviceClient.d.ts.map