Class CreateDeviceClient

Creates a mediasoup client device using the provided RTP capabilities.

Options containing the required RTP capabilities.

The RTP capabilities necessary for initializing the device.

  • A promise resolving to the created Device instance or null if creation fails.
  • Throws an error if RTP capabilities or the mediasoup client library are not provided, or if the device is unsupported by the browser.

This function initializes a mediasoup client Device using the specified RTP capabilities, enabling communication capabilities according to provided media configurations. It filters out unsupported video orientation extensions and loads router capabilities, ensuring compatibility with client configurations.

const client = new CreateDeviceClient();
const device = await client.createDeviceClient({ rtpCapabilities });
if (device) {
console.log('Device created successfully:', device);
} else {
console.log('Failed to create device.');
}

In this example, the function creates a device based on RTP capabilities, handling errors and unsupported devices gracefully.

Constructors

Methods

Constructors

Methods