Interface ClientConfig

Interface for defining the behavior of a web client.

You need to configure it when calling the createClient method to create a web client.

The mode and codec properties are required.

Hierarchy

  • ClientConfig

Index

Properties

Optional aiClientMode

aiClientMode: boolean

AI client mode. When enabled, the SDK prepares the media DataChannel required by AI QoS while creating the client.

since


   4.24.8

Optional clientRoleOptions

clientRoleOptions: ClientRoleOptions

The detailed options of the user role, including user level.

The user level determines the level of services that a user can enjoy within the permissions of the user's role. For example, an audience can choose to receive remote streams with low latency or ultra low latency. Levels affect prices.

codec

codec: SDK_CODEC

The codec that the Web browser uses for encoding.

mode

mode: SDK_MODE

The channel profile.

The SDK differentiates channel profiles and applies different optimization algorithms accordingly. For example, it prioritizes smoothness and low latency for a video call, and prioritizes video quality for a video streaming.

The SDK supports the following channel profiles:

  • "live": Sets the channel profile as live streaming. You need to go on to call setClientRole to set the client as either a host or an audience. A host can send and receive audio or video, while an audience can only receive audio or video.
  • "rtc": Sets the channel profile as communication. It is used for a one-on-one call or a group call where all users in the channel can converse freely.

Optional multiopus

multiopus: boolean

Whether to enable Multiopus multichannel audio. Defaults to false.

Set to true to send and receive audio with 4, 6, or 8 channels. Enable this option on both the sending and receiving clients. To send custom multichannel audio, specify the channel count in CustomAudioTrackInitConfig.channelCount.

Multiopus is supported on Chrome 94 or later. Firefox and Safari are not supported. Multichannel audio processing requires browser support for MediaStreamTrackProcessor and MediaStreamTrackGenerator.

since


   4.24.10

Optional role

The user role in a live interactive streaming (when mode is "live").

The user role determines the permissions that the SDK grants to a user, such as permission to publish local streams, subscribe to remote streams, and push streams to a CDN address. You can set the user role as "host" or "audience". A host can publish and subscribe to tracks, while an audience member can only subscribe to tracks. The default role in a live streaming is "audience". Before publishing tracks, you must set the user role as "host".

After creating a client, you can call setClientRole to switch the user role.