实时音视频

  • 实时音视频 > API 文档 > HarmonyOS >QNClientEventListener

    QNClientEventListener

    最近更新时间: 2024-10-31 17:10:10

    QNRTCClient 事件回调接口,用于回调 RTC 房间相关的事件,如房间状态改变等。可以在 QNRTCClient 的初始化后遵守并实现该代理。
    Index
    Core Methods
    Core Methods
    OnConnectionStateChanged
    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
    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

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