QNRTCClient
Hierarchy
-
QNCore
- QNRTCClient
Index
Event
Method
Event
Static
CONNECTION_STATE_CHANGED
- on("connection-state-changed",(connectionState: QNConnectionState, info: QNConnectionDisconnectedInfo) => void)
-
连接状态改变
Parameters-
connectionState: QNConnectionState
连接状态
-
连接信息
-
Static
MESSAGE_RECEIVED
- on("message-received",(message: QNCustomMessage) => void)
-
信息接收
Parameters-
message: QNCustomMessage
自定义消息内容
-
Static
USER_JOINED
- on("user-joined",(remoteUserID: string, userData: string) => void)
-
用户加入房间
Parameters-
remoteUserID: string
远端用户ID
-
userData: string
用户自定义信息
-
Static
USER_LEFT
- on("user-left",(remoteUserID: string) => void)
-
用户离开房间
Parameters-
remoteUserID: string
远端用户ID
-
Static
USER_PUBLISHED
- on("user-published",(userID: string, track: QNRemoteTrack | QNRemoteTrack[]) => void)
-
用户添加媒体轨
Parameters-
userID: string
-
track: QNRemoteTrack | QNRemoteTrack[]
远端发布轨
-
Static
USER_UNPUBLISHED
- on("user-unpublished",(userID: string, track: QNRemoteTrack | QNRemoteTrack[]) => void)
-
用户移除媒体轨
Parameters-
userID: string
-
track: QNRemoteTrack | QNRemoteTrack[]
远端取消发布轨
-
Method
join
- join(token: string, userData: string): Promise<void>
-
加入房间
Parameters-
token: string
房间token
-
userData: string
用户自定义信息
Returns Promise<void> -
leave
- leave(): Promise<void>
-
离开房间
Returns Promise<void>
publish
- publish(callback: QNPublishCallback): Promise<void>
-
发布流
Parameters-
callback: QNPublishCallback
发布后回调
Returns Promise<void> -
removeTranscodingLiveStreamingTracks
- removeTranscodingLiveStreamingTracks(streamID: string, transcodingTracks: QNTranscodingLiveStreamingTrack[]): Promise<void>
-
移除合流转推的布局
Parameters-
streamID: string
合流转推streamID
-
transcodingTracks: QNTranscodingLiveStreamingTrack[]
合流布局
Returns Promise<void> -
sendMessage
- sendMessage(messageID: string, message: string, users: QNRemoteUser[]): Promise<void>
-
发送自定义消息
Parameters-
messageID: string
自定义消息 ID
-
message: string
自定义消息内容
-
users: QNRemoteUser[]
默认群发,接收消息用户,传入值若为非数组或空数组,则会采用默认行为进行群发
Returns Promise<void> -
setTranscodingLiveStreamingTracks
- setTranscodingLiveStreamingTracks(streamID: string, transcodingTracks: QNTranscodingLiveStreamingTrack[]): Promise<void>
-
新增、更新合流转推的布局
Parameters-
streamID: string
合流转推streamID
-
transcodingTracks: QNTranscodingLiveStreamingTrack[]
合流布局
Returns Promise<void> -
startDirectLiveStreaming
- startDirectLiveStreaming(config: QNDirectLiveStreamingConfig): Promise<void>
-
开启单路转推
Parameters-
config: QNDirectLiveStreamingConfig
CDN转推参数
Returns Promise<void> -
startTranscodingLiveStreaming
- startTranscodingLiveStreaming(config: QNTranscodingLiveStreamingConfig): Promise<void>
-
开启合流转推
Parameters-
config: QNTranscodingLiveStreamingConfig
合流转推参数
Returns Promise<void> -
stopDirectLiveStreaming
- stopDirectLiveStreaming(streamID: string): Promise<void>
-
停止单路转推
Parameters-
streamID: string
CDN转推streamID
Returns Promise<void> -
stopTranscodingLiveStreaming
- stopTranscodingLiveStreaming(streamID: string): Promise<void>
-
停止合流转推
Parameters-
streamID: string
合流转推streamID
Returns Promise<void> -
subscribe
- subscribe(tracks: QNSubscribeConfig): Promise<string>
-
订阅流
Parameters-
tracks: QNSubscribeConfig
需要订阅的轨
Returns Promise<string> -
文档反馈
(如有产品使用问题,请 提交工单)