Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RCAudienceLivingRoom

观众直播房间类 处理: 1、通知观众房间内 人员变更、资源变更 2、观众订阅、取消订阅资源

Hierarchy

  • RCAudienceLivingRoom

Index

Constructors

  • new RCAudienceLivingRoom(_context: RTCContext, _runtime: IRuntime, _initOptions: IRCRTCInitOptions, _roomId: string, _joinResData: { token: string; kvEntries: IServerRTCRoomEntry[] }, livingType: RCLivingType, _clientSessionId?: string): RCAudienceLivingRoom
  • Parameters

    • _context: RTCContext
    • _runtime: IRuntime
    • _initOptions: IRCRTCInitOptions
    • _roomId: string
    • _joinResData: { token: string; kvEntries: IServerRTCRoomEntry[] }
      • token: string
      • kvEntries: IServerRTCRoomEntry[]
    • livingType: RCLivingType
    • _clientSessionId: string = ...

    Returns RCAudienceLivingRoom

Properties

livingType: RCLivingType

Methods

  • 获取 CDN 资源对应的拉流地址

    Parameters

    Returns Promise<{ code: RCRTCCode; CDNPlayUrl?: string }>

    CDNPlayUrl

  • 根据 trackId 获取房间内的远端资源

    Parameters

    • trackId: string

    Returns RCRemoteTrack

  • TODO 待优化

    Parameters

    • trackId: string

    Returns RCRemoteTrack

  • 观众房间事件注册

    Parameters

    Returns void

  • 音量上报

    Parameters

    Returns void

  • 注册房间数据监控

    Parameters

    Returns void

  • getRoomId(): string
  • 获取房间 Id

    Returns string

  • getCrtUserId(): string
  • 获取当前 userId

    Returns string

  • getSessionId(): string
  • 获取房间当前会话 Id,当房间内已无成员时房间会回收,重新加入时 sessionId 将更新

    Returns string

  • getRemoteUserIds(): string[]
  • 获取远程主播用户列表

    Returns string[]

  • 获取远端用户的资源列表

    Parameters

    • userId: string

    Returns RCRemoteTrack[]

  • 获取房间内所有已发布的远端资源列表, 包含合流资源

    Returns RCRemoteTrack[]

  • 获取远端 RTC tracks

    Returns RCRemoteTrack[]

  • 获取远端 MCU tracks

    Returns RCRemoteTrack[]

  • getCDNInfo(): { resolution: RCResolution; fps: RCFrameRate; CDNEnable: undefined | boolean } | { resolution: undefined; fps: undefined; CDNEnable: boolean }
  • 获取房间内 CDN 信息

    Returns { resolution: RCResolution; fps: RCFrameRate; CDNEnable: undefined | boolean } | { resolution: undefined; fps: undefined; CDNEnable: boolean }

  • getClientSessionId(): string
  • Returns string