QNClientEventListener
Index
Core Methods
Core Methods
OnConnectionStateChanged
- virtual void OnConnectionStateChanged(QNConnectionState state, const QNConnectionDisconnectedInfo* info) = 0
-
房间连接状态变化时通知
Parameters-
state: QNConnectionState
连接状态
-
断开连接时状态信息
-
OnUserJoined
- virtual void OnUserJoined(const std::string& remote_user_id, const std::string& user_data) = 0
-
远端用户加入房间时通知
Parameters-
remote_user_id: string
远端用户 id
-
user_data: string
远端用户自定义消息
-
OnUserLeft
- virtual void OnUserLeft(const std::string& remote_user_id) = 0
-
远端用户离开房间时通知
Parameters-
remote_user_id: string
远端用户 id
-
OnUserReconnecting
- virtual void OnUserReconnecting(const std::string& remote_user_id) = 0
-
远端用户重连时通知
Parameters-
remote_user_id: string
远端用户 id
-
OnUserReconnected
- virtual void OnUserReconnected(const std::string& remote_user_id) = 0
-
远端用户重连成功时通知
Parameters-
remote_user_id: string
远端用户 id
-
OnUserPublished
- virtual void OnUserPublished(const std::string& remote_user_id, const RemoteTrackList& track_list) = 0
-
远端用户发布新 track 时通知
Parameters-
remote_user_id: string
远端用户 id
-
track_list: std::list<shared_ptr<QNRemoteTrack>>
远端用户新发布的 tracks
-
OnUserUnpublished
- virtual void OnUserUnpublished(const std::string& remote_user_id, const RemoteTrackList& track_list) = 0
-
远端用户取消发布 track 时通知
Parameters-
remote_user_id: string
远端用户 id
-
track_list: std::list<shared_ptr<QNRemoteTrack>>
远端用户取消发布的 tracks
-
OnSubscribed
- virtual void OnSubscribed(const std::string& remote_user_id,const RemoteAudioTrackList& remote_audio_track_list,const RemoteVideoTrackList& remote_video_track_list) = 0
-
订阅 track 成功时通知
Parameters-
remote_user_id: string
订阅的 track 所属的远端用户
-
remote_audio_track_list: std::list<shared_ptr<QNRemoteAudioTrack>>
订阅的音频 tracks
-
remote_video_track_list: std::list<shared_ptr<QNRemoteVideoTrack>>
订阅的视频 tracks
-
OnMessageReceived
- virtual void OnMessageReceived(const CustomMessageList& message) = 0
-
接收收到新的自定义消息时通知
Parameters-
message: std::list<QNCustomMessage>
自定义消息列表
-
OnMediaRelayStateChanged
- virtual void OnMediaRelayStateChanged(const std::string& relay_room, const QNMediaRelayState state) = 0
-
跨发媒体转发状态变更,非主动调用触发,由目标房间状态变化引起此通知
目前仅当目标房间关闭时,会触发此通知
Parameters-
relay_room: string
发生状态变化的房间名
-
state: QNMediaRelayState
新状态,当前仅可能为 QNMediaRelayState::kRoomClosed
-
文档反馈
(如有产品使用问题,请 提交工单)