Skip to main content
All info classes are immutable dataclass(frozen=True) objects. What you get is a snapshot, and modifying it doesn’t affect the SDK’s internal state. For media frame types (AudioFrame / VideoFrame / AudioFormat), see Audio and video data.

Info classes

UserInfo

TrackInfo

ChannelInfo

ConnectionQuality

Uplink and downlink network quality, updated about once per second. QualitySample:

ActiveSpeaker

LayerSwitched

CustomMsg

An in-channel custom message, sent by your backend through Server API · Send a custom message. The client SDK only receives messages and doesn’t send them.

Enums

TrackKind

AUDIO = 0, VIDEO = 1.

Codec

H264, H265, VP8, VP9, AV1, OPUS, AAC.

DeviceType

WINDOWS(1), ANDROID(2), IOS(3), LINUX(4), MACOS(5), WEBRTC(6), XCX(7, WeChat Mini Program), AGENTS(80, server-side agent—the identity this SDK joins with). Other values are kept as-is as int.

ConnectionState

CONNECTING(0), CONNECTED(1), DISCONNECTED(2), RECONNECTING(3).

DisconnectReason

ErrorCode

Since 0.2.0. The last three digits of SDK error codes (an IntEnum shared across SDKs), for comparing with SdkError.base_code, such as e.base_code == srtc.ErrorCode.INVALID_ARGUMENT. The full error code is 180 + the value zero-padded to 3 digits; for example, INVALID_ARGUMENT(31) is 180031. UNKNOWN(0), NOT_IN_CHANNEL(1), TOKEN_EXPIRED(2), TRACK_NOT_FOUND(3), TOKEN_INVALID(4), CONNECTION_FAILED(6), CONNECTION_TIMEOUT(7), SIGNALING_CONNECT_FAILED(9), SIGNALING_SUBSCRIBE_FAILED(10), MESSAGE_DECODE_FAILED(11), WEBRTC_ERROR(12), SDP_NEGOTIATION_FAILED(13), TRANSPORT_NOT_READY(14), PEER_CONNECTION_FAILED(15), CODEC_NOT_SUPPORTED(19), MAX_PUBLISH_LIMIT_REACHED(20), ENGINE_DISCONNECTED(23), INVALID_STATE(24), INTERNAL_ERROR(25), CANCELLED(26), INVALID_ARGUMENT(31), FEATURE_NOT_SUPPORTED(32), MAX_SUBSCRIBE_LIMIT_REACHED(34), PUBLISH_DESC_CONFLICT(35), NOT_MCU_PUBLISHER(40), USER_NOT_FOUND(204), PUBLISH_FAILED(300), SUBSCRIBE_FAILED(301), PUBLISH_TIMEOUT(302), SUBSCRIBE_TIMEOUT(303), SUBSCRIBE_TRACK_NOT_FOUND(304). For what each code means, see Error codes.

Constants

Used when subscribing to the channel’s composite stream: