Interface IRemoteVideoTrack
远端视频轨道。
调用 subscribe 后通过 AgoraRTCRemoteUser.videoTrack 对象获取。
Events
video-element-visible-status
video-element-visible-status(data?: CheckVideoVisibleResult): void
自从 4.8.0
提示 HTML <video>
标签的可见状态和不可见原因。SDK 每 30 秒触发一次该事件。
调用 remoteVideoTrack.play
后 SDK 会创建 HTML <video>
标签用于播放视频轨道。当 remoteVideoTrack.isPlaying
为 true
却看不到图像时,你可通过此事件来进行问题排查。
参数
参数名 | 类型 | 描述 |
---|---|---|
data |
返回值
void
Properties
isPlaying
isPlaying: boolean
媒体轨道是否正在页面上播放。
-
true
: 媒体轨道正在页面上播放。 -
false
: 媒体轨道没有在页面上播放。
processorDestination
processorDestination: IBaseProcessor
自从 4.13.0
远端视频轨道上当前媒体处理链路的最终节点。
trackMediaType
trackMediaType: "audio" | "video"
媒体轨道的类型:
-
"audio"
: 音频轨道。 -
"video"
: 视频轨道。
Methods
getCurrentFrameData
getListeners
getMediaStreamTrack
getStats
getStats(): RemoteVideoTrackStats
获取远端视频轨道相关信息。
不推荐使用 请使用 AgoraRTCClient.getRemoteVideoStats 获取远端视频轨道相关信息。
返回值
getTrackId
getVideoElementVisibleStatus
getVideoElementVisibleStatus(): CheckVideoVisibleResult | undefined
- 自从 4.8.0
获取 HTML <video>
标签的可见状态和不可见原因。
调用 remoteVideoTrack.play
后 SDK 会创建 HTML <video>
标签用于播放视频轨道。当 remoteVideoTrack.isPlaying
为 true
却看不到图像时,你可调用该方法进行问题排查。
返回值
CheckVideoVisibleResult | undefined
off
on
on(event: "first-frame-decoded", listener: typeof event_first_frame_decoded): void
事件含义详见 event_first_frame_decoded。
参数
参数名 | 类型 | 描述 |
---|---|---|
event | "first-frame-decoded" | |
listener | typeof event_first_frame_decoded |
返回值
void
on(event: "video-element-visible-status", listener: typeof event_video_element_visible_status): void
事件含义详见 event_video_element_visible_status。
参数
参数名 | 类型 | 描述 |
---|---|---|
event | "video-element-visible-status" | |
listener | typeof event_video_element_visible_status |
返回值
void
once
pipe
play
play(element: string | HTMLElement, config?: VideoPlayerConfig): void
在页面上播放本地视频轨道。
参数
参数名 | 类型 | 描述 |
---|---|---|
element | string | HTMLElement | 指定一个 DOM 元素,SDK 将在这个元素下创建
|
config | 设置播放参数(镜像/显示模式)。详见 VideoPlayerConfig。对于本地视频轨道,镜像模式默认开启。 |
返回值
void
<video>
标签的可见状态信息。