实时音视频

  • 实时音视频 > API 文档 > iOS >QNRTCClientDelegate

    QNRTCClientDelegate

    最近更新时间: 2023-11-20 11:12:51

    QNRTCClient 事件回调接口,用于回调 RTC 房间相关的事件,如房间状态改变等。可以在 QNRTCClient 的初始化后遵守并实现该代理。
    Index
    Core Methods
    Core Methods
    didConnectionStateChanged
    didJoinOfUserID
    • - (void)RTCClient:(QNRTCClient *)client didJoinOfUserID:(NSString *)userID userData:(NSString *)userData;
    • 远端用户加入房间会触发此回调

      Parameters
      • client: QNRTCClient

        QNRTCClient 实例

      • userID: NSString

        用户 ID

      • userData: NSString

        用户信息

    didLeaveOfUserID
    • - (void)RTCClient:(QNRTCClient *)client didLeaveOfUserID:(NSString *)userID;
    • 远端用户离开房会触发此回调

      Parameters
      • client: QNRTCClient

        QNRTCClient 实例

      • userID: NSString

        用户 ID

    didSubscribedRemoteVideoTracks
    • - (void)RTCClient:(QNRTCClient *)client didSubscribedRemoteVideoTracks:(NSArray<QNRemoteVideoTrack *> *)videoTracks audioTracks:(NSArray<QNRemoteAudioTrack *> *)audioTracks ofUserID:(NSString *)userID;
    • 订阅远端用户成功会触发此回调

      无论手动订阅还是自动订阅都会触发此回调

      Parameters
    didUserPublishTracks
    • - (void)RTCClient:(QNRTCClient *)client didUserPublishTracks:(NSArray<QNRemoteTrack *> *)tracks ofUserID:(NSString *)userID;
    • 远端用户发布音/视频会触发此回调

      Parameters
    didUserUnpublishTracks
    • - (void)RTCClient:(QNRTCClient *)client didUserUnpublishTracks:(NSArray<QNRemoteTrack *> *)tracks ofUserID:(NSString *)userID;
    • 远端用户取消发布音/视频会触发此回调

      Parameters
    didReconnectingOfUserID
    • - (void)RTCClient:(QNRTCClient *)client didReconnectingOfUserID:(NSString *)userID;
    • 远端用户发生重连会触发此回调

      Parameters
      • client: QNRTCClient

        QNRTCClient 实例

      • userID: NSString

        用户 ID

    didReconnectedOfUserID
    • - (void)RTCClient:(QNRTCClient *)client didReconnectedOfUserID:(NSString *)userID;
    • 远端用户重连成功会触发此回调

      Parameters
      • client: QNRTCClient

        QNRTCClient 实例

      • userID: NSString

        用户 ID

    didStartLiveStreaming
    • - (void)RTCClient:(QNRTCClient *)client didStartLiveStreaming:(NSString *)streamID;
    • 成功创建转推/合流转推任务会触发此回调

      Parameters
      • client: QNRTCClient

        QNRTCClient 实例

      • streamID: NSString

        流 ID

    didStopLiveStreaming
    • - (void)RTCClient:(QNRTCClient *)client didStopLiveStreaming:(NSString *)streamID;
    • 停止转推/合流转推任务会触发此回调

      Parameters
      • client: QNRTCClient

        QNRTCClient 实例

      • streamID: NSString

        流 ID

    didTranscodingTracksUpdated
    • - (void)RTCClient:(QNRTCClient *)client didTranscodingTracksUpdated:(BOOL)success withStreamID:(NSString *)streamID;
    • 更新合流布局会触发此回调

      Parameters
      • client: QNRTCClient

        QNRTCClient 实例

      • success: BOOL

        是否成功

      • streamID: NSString

        流 ID

    didErrorLiveStreaming
    didReceiveMessage
    • - (void)RTCClient:(QNRTCClient *)client didReceiveMessage:(QNMessageInfo *)message;
    • 收到远端用户发送给自己的消息时会触发此回调

      Parameters
    firstVideoDidDecodeOfTrack
    • - (void)RTCClient:(QNRTCClient *)client firstVideoDidDecodeOfTrack:(QNRemoteVideoTrack *)videoTrack remoteUserID:(NSString *)userID;
    • 远端用户视频数据首帧渲染会触发此回调

      Parameters
    didDetachRenderTrack
    • - (void)RTCClient:(QNRTCClient *)client didDetachRenderTrack:(QNRemoteVideoTrack *)videoTrack remoteUserID:(NSString *)userID;
    • 取消渲染远端用户视频数据会触发此回调

      Parameters
    didMediaRelayStateChanged
    • - (void)RTCClient:(QNRTCClient *)client didMediaRelayStateChanged:(NSString *)relayRoom state:(QNMediaRelayState)state;
    • 跨房媒体转发状态变更的回调

      非主动调用触发,由目标房间状态变化引起此通知。目前仅当目标房间关闭 QNMediaRelayStateRoomClosed 时,会触发此通知。

      Parameters
    remoteTrackMixedDidGetAudioBuffer
    • - (void)RTCClient:(QNRTCClient *)client remoteTrackMixedDidGetAudioBuffer:(AudioBuffer *)audioBuffer;
    • 远端音频 track mix 数据的回调。

      该回调在 AU Remote IO 线程,请不要做过于耗时的操作,否则可能阻塞该线程影响音频输出或其他未知问题。

      Parameters
      • client: QNRTCClient

        QNRTCClient 实例

      • audioBuffer: AudioBuffer

        音频数据 buffer

    didNetworkQualityNotified
    didUserVolumeIndication
    • - (void)RTCClient:(QNRTCClient *)client didUserVolumeIndication:(NSArray<QNAudioVolumeInfo *>*)userVolumeList;
    • 用户音量提示回调,本地远端一起回调,本地 user id 为空。

      Parameters
    以上内容是否对您有帮助?
  • Qvm free helper
    Close