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

Properties

codec

codec: SDK_CODEC

The codec that the Web browser uses for encoding.

  • "vp8": Use VP8 for encoding.
  • "h264": Use H.264 for encoding.

Safari 12.1 or earlier does not support the VP8 codec.

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

The SDK supports the following channel profiles:

  • "live": Sets the channel profile as live broadcast. 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 role

The user role in a live broadcast channel.

If mode is set as live, use this property to set the user role. The default role is audience.

A host can publish streams or subscribe to streams, while an audience can only subscribe to streams.