IRTSRoomEventHandler class
Constructors
-
IRTSRoomEventHandler({FutureOr<void> onLeaveRoom(RTCRoomStats stats)?, FutureOr<void> onRoomStateChanged(String roomId, String uid, int state, )?, FutureOr<void> onUserJoined(UserInfo userInfo)?, FutureOr<void> onUserLeave(String uid, int reason)?, FutureOr<void> onRoomMessageReceived(long msgid, String uid, String message)?, FutureOr<void> onRoomBinaryMessageReceived(long msgid, String uid, ByteBuffer message)?, FutureOr<void> onUserMessageReceived(long msgid, String uid, String message)?, FutureOr<void> onUserBinaryMessageReceived(long msgid, String uid, ByteBuffer message)?, FutureOr<void> onUserMessageSendResult(long msgid, int error)?, FutureOr<void> onRoomMessageSendResult(long msgid, int error)?})
-
Properties
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
onLeaveRoom
↔ FutureOr<void> Function(RTCRoomStats stats)?
-
@platform android
@detail callback
@brief Leave the room successfully callback.
After the user calls the leaveRoom{@link #RTSRoom#leaveRoom} method, the SDK will stop all publishing subscription streams, and after releasing all call-related audio & video resources, this callback will notify the user to leave the room successfully.
@param stats Reserved parameter.
@note
- After the user calls the leaveRoom{@link #RTSRoom#leaveRoom} method to leave the room, if destroy{@link #RTSRoom#destroy} is called to destroy the room instance or destroyRTCEngine{@link #RTCEngine#destroyRTCEngine} method is called to destroy the RTC engine immediately, this callback event will not be received.
- If the app needs to use the system audio & video device after leaving the room, it is recommended to initialize the audio & video device after receiving this callback, otherwise the initialization may fail due to the SDK occupying the audio & video device.
getter/setter pair
-
onRoomBinaryMessageReceived
↔ FutureOr<void> Function(long msgid, String uid, ByteBuffer message)?
-
@platform android
@detail callback
@brief Receives a callback for broadcast binary messages in the room.
This callback is received when other users in the room call sendRoomBinaryMessage{@link #RTSRoom#sendRoomBinaryMessage} to send a broadcast binary message.
@param uid User ID of the message sender.
@param message The content of the received binary message.
getter/setter pair
-
onRoomMessageReceived
↔ FutureOr<void> Function(long msgid, String uid, String message)?
-
@platform android
@detail callback
@brief Receive a callback for broadcast messages in the room.
This callback is received when other users in the room call sendRoomMessage{@link #RTSRoom#sendRoomMessage} to send a broadcast message.
@param uid User ID of the message sender.
@param message The content of the received message.
getter/setter pair
-
onRoomMessageSendResult
↔ FutureOr<void> Function(long msgid, int error)?
-
@platform android
@detail callback
@brief Receives this callback after sending a text message or a binary message to a room with sendRoomMessage{@link #RTSRoom#sendRoomMessage} or sendRoomBinaryMessage{@link #RTSRoom#sendRoomBinaryMessage}.
@param msgid The ID of this message.
@param error Message sending result. See RoomMessageSendResult{@link #RoomMessageSendResult}
getter/setter pair
-
onRoomStateChanged
↔ FutureOr<void> Function(String roomId, String uid, int state, )?
-
@platform android
@detail callback
@brief Callback on room state changes. Via this callback you get notified of room relating warnings, errors and events. For example, the user joins the room, the user is removed from the room, and so on.
@param roomId Room ID.
@param uid User ID.
@param state Room state code.
- 0: Join room success.
- !0: Failed to join a room, abnormal exit, room-related warnings or errors. See ErrorCode{@link #ErrorCode} and WarningCode{@link #WarningCode} for specific indications.
@param extraInfo Extra information.
join_type indicates the type of room the user joins. 0 means the user joins the room for the first time, and 1 means the user rejoins the room.
elapsed indicates the time interval from calling joinRoom{@link #RTCRoom#joinRoom} to successfully joining room, in ms.
getter/setter pair
-
onUserBinaryMessageReceived
↔ FutureOr<void> Function(long msgid, String uid, ByteBuffer message)?
-
@platform android
@detail callback
@brief Receive this callback when you receive a peer-to-peer binary message from another user in the room via sendUserBinaryMessage{@link #RTSRoom#sendUserBinaryMessage}.
@param uid The user ID of the sender of the message.
@param message The binary message content received.
getter/setter pair
-
onUserJoined
↔ FutureOr<void> Function(UserInfo userInfo)?
-
@platform android
@detail callback
@brief You will receive this callback in following cases:
- The remote user calls setUserVisibility{@link #RTCRoom#setUserVisibility} turns visible and joins your room.
- The remote visible user is disconnected and then reconnected to your room.
- The invisible remote user in your room calls setUserVisibility{@link #RTCRoom#setUserVisibility} and turns visible.
- You join the room when there are visible users in the room.
@param userInfo User information. See UserInfo{@link #UserInfo}.
getter/setter pair
-
onUserLeave
↔ FutureOr<void> Function(String uid, int reason)?
-
@platform android
@detail callback
@brief This callback is triggered when a remote user is disconnected or turns invisible.
@param uid ID of the user who leaves the room, or switches to invisible.
@param reason Reason to leave the room:
- 0: The remote client calls leaveRoom{@link #RTSRoom#leaveRoom} to leave the room.
- 1: The remote client is disconnected because of poor network connection or expired Token.
- 2: The remote client calls setUserVisibility{@link #RTCRoom#setUserVisibility} to turn invisible.
- 3: The remote user has been removed from the room by the administrator via a OpenAPI call.
getter/setter pair
-
onUserMessageReceived
↔ FutureOr<void> Function(long msgid, String uid, String message)?
-
@platform android
@detail callback
@brief Receive this callback when you receive a peer-to-peer text message from another user in the room via sendUserMessage{@link #RTSRoom#sendUserMessage}.
@param uid The user ID of the sender of the message.
@param message The content of the received text message.
getter/setter pair
-
onUserMessageSendResult
↔ FutureOr<void> Function(long msgid, int error)?
-
@platform android
@detail callback
@brief After sending a point-to-point text or point-to-point binary message to a single user in the room, the message sender will receive a callback with the result of the message.
@param msgid The ID of this message.
@param error Text or binary message sending results. See UserMessageSendResult{@link #UserMessageSendResult}
@note Call sendUserMessage{@link #RTSRoom#sendUserMessage} or sendUserBinaryMessage{@link #RTSRoom#sendUserBinaryMessage} interface to receive this callback.
getter/setter pair
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
toString()
→ String
-
A string representation of this object.
inherited