Creates a mediasoup client device using the provided RTP capabilities.
Param: options
Options containing the required RTP capabilities.
Param: options.rtpCapabilities
The RTP capabilities necessary for initializing the device.
Returns
A promise resolving to the created Device instance or null if creation fails.
Throws
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.
Example
constclient = newCreateDeviceClient(); constdevice = awaitclient.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.
Creates a mediasoup client device using the provided RTP capabilities.
Param: options
Options containing the required RTP capabilities.
Param: options.rtpCapabilities
The RTP capabilities necessary for initializing the device.
Returns
Device
instance ornull
if creation fails.Throws
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.Example
In this example, the function creates a device based on RTP capabilities, handling errors and unsupported devices gracefully.