实时音视频

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

    QNRTCClientDelegate

    最近更新时间:2021-12-21 17:06:23

    QNRTC 全局事件回调接口,用来回调 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
    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

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

      Parameters
      • client: QNRTCClient

        QNRTCClient 实例

      • streamID: NSString

        流 ID

    didStopLiveStreamingWith
    • - (void)RTCClient:(QNRTCClient *)client didStopLiveStreamingWith:(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

    didErrorLiveStreamingWith
    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
    以上内容是否对您有帮助?
  • Qvm free helper
    Close