new Video(id, name)
- Description:
- 视频Video构造函数。
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
id |
String | 设备Id |
name |
String | 设备名称 |
Methods
applyConstraints()
- Description:
- 应用生效更新后的视频约束(分辨率、帧率等)
- Source:
applyConstraints()
- Description:
- 应用生效更新后的视频约束(分辨率、帧率等)
- Source:
applyConstraintsWH(width, height, resolutionSetType-)
- Description:
- 视频打开时,分辨率即时更新生效,且通知给服务器
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
width |
int | |
height |
int | |
resolutionSetType- |
string | 分辨率设置类型,可不填写,null时默认为期望即ResolutionSetType.ideal,也可填写强制,即ResolutionSetType.exact; |
applyConstraintsWH(width, height, resolutionSetType-)
- Description:
- 视频打开时,分辨率即时更新生效,且通知给服务器
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
width |
int | |
height |
int | |
resolutionSetType- |
string | 分辨率设置类型,可不填写,null时默认为期望即ResolutionSetType.ideal,也可填写强制,即ResolutionSetType.exact; |
attachVideoElementMediaStream(element, stream)
- Description:
- 视频流渲染进视频控件
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
element |
Object | - 视频控件对象 |
stream |
Object | - 视频流 |
attachVideoElementMediaStream(element, stream)
- Description:
- 视频流渲染进视频控件
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
element |
Object | - 视频控件对象 |
stream |
Object | - 视频流 |
canUseVirtualBackground() → {Promise.<boolean>}
- Description:
- 检查虚拟背景是否可用
- Source:
Returns:
- Type
- Promise.<boolean>
canUseVirtualBackground() → {Promise.<boolean>}
- Description:
- 检查虚拟背景是否可用
- Source:
Returns:
- Type
- Promise.<boolean>
changePublishVideoQuality(level)
- Description:
- 更改发布视频源端的视频质量
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
level |
级别 |
changePublishVideoQuality(level)
- Description:
- 更改发布视频源端的视频质量
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
level |
级别 |
changeSubscribedVideoQuality(quality-)
- Description:
- 更改订阅视频的视频质量
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
quality- |
int | 视频质量枚举值,如可传VideoQualityType.high |
changeSubscribedVideoQuality(quality-)
- Description:
- 更改订阅视频的视频质量
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
quality- |
int | 视频质量枚举值,如可传VideoQualityType.high |
disableVirtualBackground()
- Description:
- 禁用虚拟背景
- Source:
disableVirtualBackground()
- Description:
- 禁用虚拟背景
- Source:
enableVirtualBackground(background, options) → {Promise}
- Description:
- 启用虚拟背景
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
background |
string | 背景图片 URL、颜色值或 'blur' |
options |
Object | 可选配置 { processorType: 'mediaPipe', quality: 'high'|'medium'|'low' } |
Returns:
- Type
- Promise
enableVirtualBackground(background, options) → {Promise}
- Description:
- 启用虚拟背景
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
background |
string | 背景图片 URL、颜色值或 'blur' |
options |
Object | 可选配置 { processorType: 'mediaPipe', quality: 'high'|'medium'|'low' } |
Returns:
- Type
- Promise
getNewStreamByTrack() → {MediaStream|null}
- Description:
- 通过track生成新的MediaStream,虚拟背景启用时返回处理后的track
- Source:
Returns:
- Type
- MediaStream | null
getNewStreamByTrack() → {MediaStream|null}
- Description:
- 通过track生成新的MediaStream,虚拟背景启用时返回处理后的track
- Source:
Returns:
- Type
- MediaStream | null
ismuteCamera()
- Description:
- 获取禁视频状态
- Source:
ismuteCamera()
- Description:
- 获取禁视频状态
- Source:
muteCamera()
- Description:
- 禁视频
- Source:
muteCamera()
- Description:
- 禁视频
- Source:
(async) preview(element)
- Description:
- 预览摄像头。
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
element |
Object | 视频控件对象 |
(async) preview(element)
- Description:
- 预览摄像头。
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
element |
Object | 视频控件对象 |
(async) previewAndPublish(element, isRejoinCall)
- Description:
- 预览摄像头及发布流
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
element |
Object | 视频控件对象 |
isRejoinCall |
Object | 是否为重新加入会议 |
(async) previewAndPublish(element, isRejoinCall)
- Description:
- 预览摄像头及发布流
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
element |
Object | 视频控件对象 |
isRejoinCall |
Object | 是否为重新加入会议 |
(async) publish(isRejoinCall)
- Description:
- 发布视频流。
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
isRejoinCall |
boolean | 是否是重新加入会议。 |
(async) publish(isRejoinCall)
- Description:
- 发布视频流。
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
isRejoinCall |
boolean | 是否是重新加入会议。 |
(async) sendVideoStreamControl(maxBandwidth, width, height)
- Description:
- 发PDU消息给服务器,如可以实现1080P的码流达到10M
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
maxBandwidth |
Object | 最大带宽 |
width |
int | 宽 |
height |
int | 高 |
(async) sendVideoStreamControl(maxBandwidth, width, height)
- Description:
- 发PDU消息给服务器,如可以实现1080P的码流达到10M
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
maxBandwidth |
Object | 最大带宽 |
width |
int | 宽 |
height |
int | 高 |
setAspectRatio(aspectRatio-)
- Description:
- 设置分辨率宽高比
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
aspectRatio- |
Object | 分辨率宽高比(1.7777777778, 1.3333333333),16:9或4:3时会开启强制 |
setAspectRatio(aspectRatio-)
- Description:
- 设置分辨率宽高比
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
aspectRatio- |
Object | 分辨率宽高比(1.7777777778, 1.3333333333),16:9或4:3时会开启强制 |
setBandwidth(maxBandwidth-)
- Description:
- 设置带宽
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
maxBandwidth- |
int | 最大带宽 |
setBandwidth(maxBandwidth-)
- Description:
- 设置带宽
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
maxBandwidth- |
int | 最大带宽 |
setDescription(description)
- Description:
- 设置备注
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
description |
String | 备注 |
setDescription(description)
- Description:
- 设置备注
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
description |
String | 备注 |
setFrameRate(frameRate-)
- Description:
- 设置帧率
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
frameRate- |
String | 帧率 |
setFrameRate(frameRate-)
- Description:
- 设置帧率
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
frameRate- |
String | 帧率 |
setLevel(level)
- Description:
- 设置摄像头的优先级别
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
level |
int | 优先级别 |
setLevel(level)
- Description:
- 设置摄像头的优先级别
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
level |
int | 优先级别 |
setMaxSpatialLayer(spatialLayer)
- Description:
- 视频多流时,设置最大空域层数
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
spatialLayer |
int | 最大空域层数 |
setMaxSpatialLayer(spatialLayer)
- Description:
- 视频多流时,设置最大空域层数
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
spatialLayer |
int | 最大空域层数 |
setResolution(resolution-, resolutionSetType-)
- Description:
- 设置分辨率
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
resolution- |
String | 分辨率标识 |
resolutionSetType- |
Object | 分辨率设置类型,可不填写,null时默认为期望即ResolutionSetType.ideal,也可填写强制,即ResolutionSetType.exact; |
setResolution(resolution-, resolutionSetType-)
- Description:
- 设置分辨率
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
resolution- |
String | 分辨率标识 |
resolutionSetType- |
Object | 分辨率设置类型,可不填写,null时默认为期望即ResolutionSetType.ideal,也可填写强制,即ResolutionSetType.exact; |
setResolutionWH(width-, height-, resolutionSetType-)
- Description:
- 设置分辨率
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
width- |
int | 宽度 |
height- |
int | 高度 |
resolutionSetType- |
string | 分辨率设置类型,可不填写,null时默认为期望即ResolutionSetType.ideal,也可填写强制,即ResolutionSetType.exact; |
setResolutionWH(width-, height-, resolutionSetType-)
- Description:
- 设置分辨率
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
width- |
int | 宽度 |
height- |
int | 高度 |
resolutionSetType- |
string | 分辨率设置类型,可不填写,null时默认为期望即ResolutionSetType.ideal,也可填写强制,即ResolutionSetType.exact; |
setSpatialLayerActive(baseActive, ass1Active, ass2Active)
- Description:
- 视频多流时,设置空域每层开启的状态。状态值定义: 0-维持原状, 1-unactive, 2-active
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
baseActive |
int | 第一层状态 |
ass1Active |
int | 第二层状态 |
ass2Active |
int | 第三层状态 |
setSpatialLayerActive(baseActive, ass1Active, ass2Active)
- Description:
- 视频多流时,设置空域每层开启的状态。状态值定义: 0-维持原状, 1-unactive, 2-active
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
baseActive |
int | 第一层状态 |
ass1Active |
int | 第二层状态 |
ass2Active |
int | 第三层状态 |
setStreamName(streamName)
- Description:
- 设置导出时视频流名称
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
streamName |
String | 视频流名称 |
setStreamName(streamName)
- Description:
- 设置导出时视频流名称
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
streamName |
String | 视频流名称 |
setStreamNickName(streamNickName)
- Description:
- 设置导出时视频流昵称
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
streamNickName |
String | 视频流昵称 |
setStreamNickName(streamNickName)
- Description:
- 设置导出时视频流昵称
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
streamNickName |
String | 视频流昵称 |
(async) subscrible(videoQuality-)
- Description:
- 订阅视频流
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
videoQuality- |
int | 视频质量举值,可以不填写,默认为VideoQualityType.high |
(async) subscrible(videoQuality-)
- Description:
- 订阅视频流
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
videoQuality- |
int | 视频质量举值,可以不填写,默认为VideoQualityType.high |
unmuteCamera()
- Description:
- 取消禁视频
- Source:
unmuteCamera()
- Description:
- 取消禁视频
- Source:
unpreview()
- Description:
- 取消预览摄像头。
- Source:
unpreview()
- Description:
- 取消预览摄像头。
- Source:
(async) unpublish()
- Description:
- 取消发布视频流。
- Source:
(async) unpublish()
- Description:
- 取消发布视频流。
- Source:
(async) unsubscrible()
- Description:
- 取消订阅视频流。
- Source:
(async) unsubscrible()
- Description:
- 取消订阅视频流。
- Source:
updateCameraData(level, description)
- Description:
- 摄像头数据更改
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
level |
int | |
description |
String |
updateCameraData(level, description)
- Description:
- 摄像头数据更改
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
level |
int | |
description |
String |
(async) updateExporterStreamName(streamName, streamNickName)
- Description:
- 更新导出时视频流的名称及昵称
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
streamName |
String | 视频流名称 |
streamNickName |
String | 视频流昵称 |
(async) updateExporterStreamName(streamName, streamNickName)
- Description:
- 更新导出时视频流的名称及昵称
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
streamName |
String | 视频流名称 |
streamNickName |
String | 视频流昵称 |