Callback interfaces

更新时间:
复制 MD 格式

Callback interfaces provide feedback for primary interfaces and return business notifications. They are encapsulated in the ArtvcRoom class.

Note

A UID can contain only letters, digits, and underscores (_). It cannot exceed 128 characters in length.

OnConnect(data)

Callback for a successful connection.

Callback parameter

Type

Description

data

JSON

OnGetSign(bizName, appId, uid, workspaceId)

Note

The value returned by this callback must be passed to the SDK.

You can obtain the signature.

Callback parameter

Type

Description

bizName

String

Corresponds to the biz_name of Connect.

appId

String

Corresponds to the appId of Connect.

uid

String

Corresponds to the UID of Connect.

workspaceId

String

Corresponds to the workspaceId of Connect.

OnError(data)

Callback for an error notification.

Callback parameter

Type

Description

data

JSON

OnCreateRoom(data)

Callback for a successful room creation.

Callback parameter

Type

Description

data

JSON

OnJoinRoom(data)

Callback for successfully joining a room.

Callback parameter

Type

Description

data

JSON

OnPublish(data)

Callback for a successful media stream publication.

Callback parameter

Type

Description

data

JSON

  • pushUrl: The stream ingest URL.

OnSubscribe(data)

Callback for a successful media stream subscription.

Callback parameter

Type

Description

data

JSON

  • liveUrl: The stream ingest URL.

OnLeaveRoom(data)

Callback for leaving a room.

Callback parameter

Type

Description

data

JSON

  • leaveType

    • 1: Normal exit

    • 2: Abnormal exit

OnParticipantLeaveRoom(data)

Callback to notify that a participant has left the room.

Callback parameter

Type

Description

data

JSON

  • participant: The user UID.

  • exitType

    • 1: Normal exit

    • 2: Abnormal exit

OnSendTxtMessageSucc(data)

Callback for a successful text message transmission.

Callback parameter

Type

Description

msgId

number

The ID of the sent text message.

OnGetTxtMessage(data)

Callback for a successful text message retrieval.

Callback parameter

Type

Description

mgsId

int

The ID of the text message.

uid

int

The UID of the user who sent the text message.

msg

String

The content of the text message.

OnGetFeedIdsD(Array)

Callback for successfully retrieving information about all users in the current room.

Callback parameter

Type

Value

Value type

Description

Array

Array

feedId

String

The ID required to subscribe to the stream.

uid

String

User ID.

tag

String

Custom tag.

OnClientJoin(Data)

Callback to notify that a user has joined the room.

Callback parameter

Type

Value

Value type

Description

Data

JSON

feedId

String

The ID required to subscribe to the stream.

uid

String

User ID.

tag

String

Custom tag.

OnInviteRequest(roomId, rtoken, inviter, extra, inviteId, inviteInfo)

Callback for receiving an invitation to join a room.

Callback parameter

Type

Description

roomId

The ID of the room to join.

rtoken

The token for the room to join.

inviter

The ID of the user who sent the invitation.

extra

Extra information.

inviteId

The ID of the invitation.

inviteInfo

Indicates whether the inviter's video and audio are enabled.