QNClientEventListener
Index
Core Methods
Core Methods
OnConnectionStateChanged
- OnConnectionStateChanged: (state: QNConnectionState, info: QNConnectionDisconnectedInfo) => void
-
当房间状态改变时会触发此回调
当状态变为 Reconnecting 时,SDK 会为您自动重连,重连过程中,如果希望退出,直接调用 leave 即可。重连成功后的状态将变为 Reconnected。
Parameters-
state: QNConnectionState
房间状态
-
房间失去连接的具体信息
-
OnUserJoined
- OnUserJoined: (remoteUserId: string, userData: string) => void
-
远端用户加入房间会触发此回调
Parameters-
remoteUserId: string
用户 ID
-
userData: string
用户信息
-
OnUserLeft
- OnUserLeft: (remoteUserId: string) => void
-
远端用户离开房会触发此回调
Parameters-
userID: string
用户 ID
-
OnSubscribed
- OnSubscribed: (userid: string, remoteAudioTrackList: QNRemoteAudioTrack[], remoteVideoTrackList: QNRemoteVideoTrack[]) => void
-
订阅远端用户成功会触发此回调
无论手动订阅还是自动订阅都会触发此回调
Parameters-
userID: string
用户 ID
-
remoteAudioTrackList: QNRemoteAudioTrack[]
远端视频 Tracks
-
remoteVideoTrackList: QNRemoteVideoTrack[]
远端音频 Tracks
-
OnUserPublished
- OnUserPublished: (remoteUserId: string, remoteTrackList: QNRemoteTrack[]) => void
-
远端用户发布音/视频会触发此回调
Parameters-
remoteUserId: string
用户 ID
-
remoteTrackList: QNRemoteTrack[]
远端 Tracks
-
OnUserUnpublished
- OnUserUnpublished: (remoteUserId: string, remoteTrackList: QNRemoteTrack[]) => void
-
远端用户取消发布音/视频会触发此回调
Parameters-
remoteUserId: string
用户 ID
-
remoteTrackList: QNRemoteTrack[]
远端 Tracks
-
OnUserReconnecting
- OnUserReconnecting: (remoteUserId: string) => void
-
远端用户发生重连会触发此回调
Parameters-
remoteUserId: string
远端用户 ID
-
OnUserReconnected
- OnUserReconnected: (remoteUserId: string) => void
-
远端用户重连成功会触发此回调
Parameters-
remoteUserId: string
远端用户 ID
-
文档反馈
(如有产品使用问题,请 提交工单)