QNRTCClientDelegate
- didConnectionStateChanged
- didJoinOfUserID
- didLeaveOfUserID
- didSubscribedRemoteVideoTracks
- didUserPublishTracks
- didUserUnpublishTracks
- didReconnectingOfUserID
- didReconnectedOfUserID
- didStartLiveStreaming
- didStopLiveStreaming
- didTranscodingTracksUpdated
- didErrorLiveStreaming
- didReceiveMessage
- firstVideoDidDecodeOfTrack
- didDetachRenderTrack
- didMediaRelayStateChanged
- remoteTrackMixedDidGetAudioBuffer
- didNetworkQualityNotified
- didUserVolumeIndication
- - (void)RTCClient:(QNRTCClient *)client didConnectionStateChanged:(QNConnectionState)state disconnectedInfo:(QNConnectionDisconnectedInfo *)info;
-
房间状态变更会触发此回调
当状态变为 QNConnectionStateReconnecting 时,SDK 会为您自动重连,重连过程中,如果希望退出,直接调用 leave 即可。重连成功后的状态将变为 QNConnectionStateReconnected。
Parameters-
client: QNRTCClient
QNRTCClient 实例
-
state: QNConnectionState
房间状态
-
房间失去连接的具体信息
-
- - (void)RTCClient:(QNRTCClient *)client didJoinOfUserID:(NSString *)userID userData:(NSString *)userData;
-
远端用户加入房间会触发此回调
Parameters-
client: QNRTCClient
QNRTCClient 实例
-
userID: NSString
用户 ID
-
userData: NSString
用户信息
-
- - (void)RTCClient:(QNRTCClient *)client didLeaveOfUserID:(NSString *)userID;
-
远端用户离开房会触发此回调
Parameters-
client: QNRTCClient
QNRTCClient 实例
-
userID: NSString
用户 ID
-
- - (void)RTCClient:(QNRTCClient *)client didSubscribedRemoteVideoTracks:(NSArray<QNRemoteVideoTrack *> *)videoTracks audioTracks:(NSArray<QNRemoteAudioTrack *> *)audioTracks ofUserID:(NSString *)userID;
-
订阅远端用户成功会触发此回调
无论手动订阅还是自动订阅都会触发此回调
Parameters-
client: QNRTCClient
QNRTCClient 实例
-
videoTracks: NSArray<QNRemoteVideoTrack>
远端视频 Tracks
-
audioTracks: NSArray<QNRemoteAudioTrack>
远端音频 Tracks
-
userID: NSString
用户 ID
-
- - (void)RTCClient:(QNRTCClient *)client didUserPublishTracks:(NSArray<QNRemoteTrack *> *)tracks ofUserID:(NSString *)userID;
-
远端用户发布音/视频会触发此回调
Parameters-
client: QNRTCClient
QNRTCClient 实例
-
tracks: NSArray<QNRemoteTrack>
远端 Tracks
-
userID: NSString
用户 ID
-
- - (void)RTCClient:(QNRTCClient *)client didUserUnpublishTracks:(NSArray<QNRemoteTrack *> *)tracks ofUserID:(NSString *)userID;
-
远端用户取消发布音/视频会触发此回调
Parameters-
client: QNRTCClient
QNRTCClient 实例
-
tracks: NSArray<QNRemoteTrack>
远端 Tracks
-
userID: NSString
用户 ID
-
- - (void)RTCClient:(QNRTCClient *)client didReconnectingOfUserID:(NSString *)userID;
-
远端用户发生重连会触发此回调
Parameters-
client: QNRTCClient
QNRTCClient 实例
-
userID: NSString
用户 ID
-
- - (void)RTCClient:(QNRTCClient *)client didReconnectedOfUserID:(NSString *)userID;
-
远端用户重连成功会触发此回调
Parameters-
client: QNRTCClient
QNRTCClient 实例
-
userID: NSString
用户 ID
-
- - (void)RTCClient:(QNRTCClient *)client didStartLiveStreaming:(NSString *)streamID;
-
成功创建转推/合流转推任务会触发此回调
Parameters-
client: QNRTCClient
QNRTCClient 实例
-
streamID: NSString
流 ID
-
- - (void)RTCClient:(QNRTCClient *)client didStopLiveStreaming:(NSString *)streamID;
-
停止转推/合流转推任务会触发此回调
Parameters-
client: QNRTCClient
QNRTCClient 实例
-
streamID: NSString
流 ID
-
- - (void)RTCClient:(QNRTCClient *)client didTranscodingTracksUpdated:(BOOL)success withStreamID:(NSString *)streamID;
-
更新合流布局会触发此回调
Parameters-
client: QNRTCClient
QNRTCClient 实例
-
success: BOOL
是否成功
-
streamID: NSString
流 ID
-
- - (void)RTCClient:(QNRTCClient *)client didErrorLiveStreaming:(NSString *)streamID errorInfo:(QNLiveStreamingErrorInfo *)errorInfo;
-
单路转推或合流转推出错会触发此回调
Parameters-
client: QNRTCClient
QNRTCClient 实例
-
streamID: NSString
流 ID
-
errorInfo: QNLiveStreamingErrorInfo
错误信息
-
- - (void)RTCClient:(QNRTCClient *)client didReceiveMessage:(QNMessageInfo *)message;
-
收到远端用户发送给自己的消息时会触发此回调
Parameters-
client: QNRTCClient
QNRTCClient 实例
-
message: QNMessageInfo
消息信息对象
-
- - (void)RTCClient:(QNRTCClient *)client firstVideoDidDecodeOfTrack:(QNRemoteVideoTrack *)videoTrack remoteUserID:(NSString *)userID;
-
远端用户视频数据首帧渲染会触发此回调
Parameters-
client: QNRTCClient
QNRTCClient 实例
-
videoTrack: QNRemoteVideoTrack
远端视频 Track
-
userID: NSString
用户 ID
-
- - (void)RTCClient:(QNRTCClient *)client didDetachRenderTrack:(QNRemoteVideoTrack *)videoTrack remoteUserID:(NSString *)userID;
-
取消渲染远端用户视频数据会触发此回调
Parameters-
client: QNRTCClient
QNRTCClient 实例
-
videoTrack: QNRemoteVideoTrack
远端视频 Track
-
userID: NSString
用户 ID
-
- - (void)RTCClient:(QNRTCClient *)client didMediaRelayStateChanged:(NSString *)relayRoom state:(QNMediaRelayState)state;
-
跨房媒体转发状态变更的回调
非主动调用触发,由目标房间状态变化引起此通知。目前仅当目标房间关闭 QNMediaRelayStateRoomClosed 时,会触发此通知。
Parameters-
client: QNRTCClient
QNRTCClient 实例
-
relayRoom: NSString
目标房间名称
-
state: QNMediaRelayState
目标房间媒体转发状态
-
- - (void)RTCClient:(QNRTCClient *)client remoteTrackMixedDidGetAudioBuffer:(AudioBuffer *)audioBuffer;
-
远端音频 track mix 数据的回调。
该回调在 AU Remote IO 线程,请不要做过于耗时的操作,否则可能阻塞该线程影响音频输出或其他未知问题。
Parameters-
client: QNRTCClient
QNRTCClient 实例
-
audioBuffer: AudioBuffer
音频数据 buffer
-
- - (void)RTCClient:(QNRTCClient *)client didNetworkQualityNotified:(QNNetworkQuality *)quality;
-
本地网络质量信息的回调。
Parameters-
client: QNRTCClient
QNRTCClient 实例
-
quality: QNNetworkQuality
上下行的网络质量
-
- - (void)RTCClient:(QNRTCClient *)client didUserVolumeIndication:(NSArray<QNAudioVolumeInfo *>*)userVolumeList;
-
用户音量提示回调,本地远端一起回调,本地 user id 为空。
Parameters-
client: QNRTCClient
QNRTCClient 实例
-
userVolumeList: NSArray<QNAudioVolumeInfo *>*
用户音量信息,按音量由高到低排序
-