# Screen

#### new Screen(id, name)

Description:
  - 桌面共享Screen构造函数。
Source:
  - stream/screen.js, line 10

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | String | 设备Id
`name` | String | 设备名称

### Members

#### attachScreenElementMediaStream

Description:
  - 桌面共享流渲染进视频控件
Source:
  - stream/screen.js, line 851

桌面共享流渲染进视频控件

#### attachScreenElementMediaStream

Description:
  - 桌面共享流渲染进视频控件
Source:
  - stream/screen.js, line 851

桌面共享流渲染进视频控件

#### (async) electronPrimaryDisplayPublish

Description:
  - electron 发布主屏幕桌面共享
Source:
  - stream/screen.js, line 369

electron 发布主屏幕桌面共享

#### (async) electronPrimaryDisplayPublish

Description:
  - electron 发布主屏幕桌面共享
Source:
  - stream/screen.js, line 369

electron 发布主屏幕桌面共享

#### (async) electronPublish

Description:
  - electron 发布桌面共享，主要用于electron v12版本之前或者该示例添加了contextIsolation: false
Source:
  - stream/screen.js, line 345

electron 发布桌面共享，主要用于electron v12版本之前或者该示例添加了contextIsolation: false

#### (async) electronPublish

Description:
  - electron 发布桌面共享，主要用于electron v12版本之前或者该示例添加了contextIsolation: false
Source:
  - stream/screen.js, line 345

electron 发布桌面共享，主要用于electron v12版本之前或者该示例添加了contextIsolation: false

#### getDisplaySurface

Description:
  - 获取当前桌面共享弹窗显示内容选项
Source:
  - stream/screen.js, line 75

获取当前桌面共享弹窗显示内容选项

#### getDisplaySurface

Description:
  - 获取当前桌面共享弹窗显示内容选项
Source:
  - stream/screen.js, line 75

获取当前桌面共享弹窗显示内容选项

#### muteScreenAudio

Description:
  - 屏幕共享静音
Source:
  - stream/screen.js, line 872

屏幕共享静音

#### muteScreenAudio

Description:
  - 屏幕共享静音
Source:
  - stream/screen.js, line 872

屏幕共享静音

#### preview

Description:
  - 预览桌面共享，只能获取桌面共享流后或发布后操作后才能调用
Source:
  - stream/screen.js, line 124

预览桌面共享，只能获取桌面共享流后或发布后操作后才能调用

#### preview

Description:
  - 预览桌面共享，只能获取桌面共享流后或发布后操作后才能调用
Source:
  - stream/screen.js, line 124

预览桌面共享，只能获取桌面共享流后或发布后操作后才能调用

#### (async) publish

Description:
  - 发布桌面共享。
Source:
  - stream/screen.js, line 223

发布桌面共享。

#### (async) publish

Description:
  - 发布桌面共享。
Source:
  - stream/screen.js, line 223

发布桌面共享。

#### (async) publishHandle

Description:
  - electron桌面共享发布接口，electron 12之前的版本建议使用electronPublish
Source:
  - stream/screen.js, line 678

electron桌面共享发布接口，electron 12之前的版本建议使用electronPublish

#### (async) publishHandle

Description:
  - electron桌面共享发布接口，electron 12之前的版本建议使用electronPublish
Source:
  - stream/screen.js, line 678

electron桌面共享发布接口，electron 12之前的版本建议使用electronPublish

#### setBandwidth

Description:
  - 设置带宽
Source:
  - stream/screen.js, line 572

设置带宽

#### setBandwidth

Description:
  - 设置带宽
Source:
  - stream/screen.js, line 572

设置带宽

#### setDescription

Description:
  - 设置备注
Source:
  - stream/screen.js, line 93

设置备注

#### setDescription

Description:
  - 设置备注
Source:
  - stream/screen.js, line 93

设置备注

#### setDisplaySurface

Description:
  - 设置桌面共享弹窗显示内容选项，chrome71及以后就支持displaySurface参数，但设置后未生效，96版本才开始真正生效。
Source:
  - stream/screen.js, line 64

设置桌面共享弹窗显示内容选项，chrome71及以后就支持displaySurface参数，但设置后未生效，96版本才开始真正生效。

##### Example

    screen.setDisplaySurface(ScreenDisplaySurface.monitor);

#### setDisplaySurface

Description:
  - 设置桌面共享弹窗显示内容选项，chrome71及以后就支持displaySurface参数，但设置后未生效，96版本才开始真正生效。
Source:
  - stream/screen.js, line 64

设置桌面共享弹窗显示内容选项，chrome71及以后就支持displaySurface参数，但设置后未生效，96版本才开始真正生效。

##### Example

    screen.setDisplaySurface(ScreenDisplaySurface.monitor);

#### setFrameRate

Description:
  - 设置帧率
Source:
  - stream/screen.js, line 115

设置帧率

#### setFrameRate

Description:
  - 设置帧率
Source:
  - stream/screen.js, line 115

设置帧率

#### setLevel

Description:
  - 设置桌面共享的优先级别
Source:
  - stream/screen.js, line 84

设置桌面共享的优先级别

#### setLevel

Description:
  - 设置桌面共享的优先级别
Source:
  - stream/screen.js, line 84

设置桌面共享的优先级别

#### setResolution

Description:
  - 设置分辨率
Source:
  - stream/screen.js, line 103

设置分辨率

#### setResolution

Description:
  - 设置分辨率
Source:
  - stream/screen.js, line 103

设置分辨率

#### setScreenAudioEnabled

Description:
  - 屏幕共享时是否同时共享屏幕音频
Source:
  - stream/screen.js, line 864

屏幕共享时是否同时共享屏幕音频

#### setScreenAudioEnabled

Description:
  - 屏幕共享时是否同时共享屏幕音频
Source:
  - stream/screen.js, line 864

屏幕共享时是否同时共享屏幕音频

#### (async) subscrible

Description:
  - 订阅桌面共享流
Source:
  - stream/screen.js, line 485

订阅桌面共享流

#### (async) subscrible

Description:
  - 订阅桌面共享流
Source:
  - stream/screen.js, line 485

订阅桌面共享流

#### unmuteScreenAudio

Description:
  - 取消屏幕共享静音
Source:
  - stream/screen.js, line 881

取消屏幕共享静音

#### unmuteScreenAudio

Description:
  - 取消屏幕共享静音
Source:
  - stream/screen.js, line 881

取消屏幕共享静音

#### (async) unpublish

Source:
  - stream/screen.js, line 422

#### (async) unpublish

Source:
  - stream/screen.js, line 422

#### (async) unsubscrible

Description:
  - 取消订阅桌面共享流
Source:
  - stream/screen.js, line 529

取消订阅桌面共享流

#### (async) unsubscrible

Description:
  - 取消订阅桌面共享流
Source:
  - stream/screen.js, line 529

取消订阅桌面共享流

#### updateScreenData

Description:
  - 桌面共享数据更改
Source:
  - stream/screen.js, line 661

桌面共享数据更改

#### updateScreenData

Description:
  - 桌面共享数据更改
Source:
  - stream/screen.js, line 661

桌面共享数据更改

## Screen

#### new Screen(id, name)

Description:
  - 桌面共享Screen构造函数。
Source:
  - stream/screen.js, line 10

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | String | 设备Id
`name` | String | 设备名称

### Members

#### attachScreenElementMediaStream

Description:
  - 桌面共享流渲染进视频控件
Source:
  - stream/screen.js, line 851

桌面共享流渲染进视频控件

#### attachScreenElementMediaStream

Description:
  - 桌面共享流渲染进视频控件
Source:
  - stream/screen.js, line 851

桌面共享流渲染进视频控件

#### (async) electronPrimaryDisplayPublish

Description:
  - electron 发布主屏幕桌面共享
Source:
  - stream/screen.js, line 369

electron 发布主屏幕桌面共享

#### (async) electronPrimaryDisplayPublish

Description:
  - electron 发布主屏幕桌面共享
Source:
  - stream/screen.js, line 369

electron 发布主屏幕桌面共享

#### (async) electronPublish

Description:
  - electron 发布桌面共享，主要用于electron v12版本之前或者该示例添加了contextIsolation: false
Source:
  - stream/screen.js, line 345

electron 发布桌面共享，主要用于electron v12版本之前或者该示例添加了contextIsolation: false

#### (async) electronPublish

Description:
  - electron 发布桌面共享，主要用于electron v12版本之前或者该示例添加了contextIsolation: false
Source:
  - stream/screen.js, line 345

electron 发布桌面共享，主要用于electron v12版本之前或者该示例添加了contextIsolation: false

#### getDisplaySurface

Description:
  - 获取当前桌面共享弹窗显示内容选项
Source:
  - stream/screen.js, line 75

获取当前桌面共享弹窗显示内容选项

#### getDisplaySurface

Description:
  - 获取当前桌面共享弹窗显示内容选项
Source:
  - stream/screen.js, line 75

获取当前桌面共享弹窗显示内容选项

#### muteScreenAudio

Description:
  - 屏幕共享静音
Source:
  - stream/screen.js, line 872

屏幕共享静音

#### muteScreenAudio

Description:
  - 屏幕共享静音
Source:
  - stream/screen.js, line 872

屏幕共享静音

#### preview

Description:
  - 预览桌面共享，只能获取桌面共享流后或发布后操作后才能调用
Source:
  - stream/screen.js, line 124

预览桌面共享，只能获取桌面共享流后或发布后操作后才能调用

#### preview

Description:
  - 预览桌面共享，只能获取桌面共享流后或发布后操作后才能调用
Source:
  - stream/screen.js, line 124

预览桌面共享，只能获取桌面共享流后或发布后操作后才能调用

#### (async) publish

Description:
  - 发布桌面共享。
Source:
  - stream/screen.js, line 223

发布桌面共享。

#### (async) publish

Description:
  - 发布桌面共享。
Source:
  - stream/screen.js, line 223

发布桌面共享。

#### (async) publishHandle

Description:
  - electron桌面共享发布接口，electron 12之前的版本建议使用electronPublish
Source:
  - stream/screen.js, line 678

electron桌面共享发布接口，electron 12之前的版本建议使用electronPublish

#### (async) publishHandle

Description:
  - electron桌面共享发布接口，electron 12之前的版本建议使用electronPublish
Source:
  - stream/screen.js, line 678

electron桌面共享发布接口，electron 12之前的版本建议使用electronPublish

#### setBandwidth

Description:
  - 设置带宽
Source:
  - stream/screen.js, line 572

设置带宽

#### setBandwidth

Description:
  - 设置带宽
Source:
  - stream/screen.js, line 572

设置带宽

#### setDescription

Description:
  - 设置备注
Source:
  - stream/screen.js, line 93

设置备注

#### setDescription

Description:
  - 设置备注
Source:
  - stream/screen.js, line 93

设置备注

#### setDisplaySurface

Description:
  - 设置桌面共享弹窗显示内容选项，chrome71及以后就支持displaySurface参数，但设置后未生效，96版本才开始真正生效。
Source:
  - stream/screen.js, line 64

设置桌面共享弹窗显示内容选项，chrome71及以后就支持displaySurface参数，但设置后未生效，96版本才开始真正生效。

##### Example

    screen.setDisplaySurface(ScreenDisplaySurface.monitor);

#### setDisplaySurface

Description:
  - 设置桌面共享弹窗显示内容选项，chrome71及以后就支持displaySurface参数，但设置后未生效，96版本才开始真正生效。
Source:
  - stream/screen.js, line 64

设置桌面共享弹窗显示内容选项，chrome71及以后就支持displaySurface参数，但设置后未生效，96版本才开始真正生效。

##### Example

    screen.setDisplaySurface(ScreenDisplaySurface.monitor);

#### setFrameRate

Description:
  - 设置帧率
Source:
  - stream/screen.js, line 115

设置帧率

#### setFrameRate

Description:
  - 设置帧率
Source:
  - stream/screen.js, line 115

设置帧率

#### setLevel

Description:
  - 设置桌面共享的优先级别
Source:
  - stream/screen.js, line 84

设置桌面共享的优先级别

#### setLevel

Description:
  - 设置桌面共享的优先级别
Source:
  - stream/screen.js, line 84

设置桌面共享的优先级别

#### setResolution

Description:
  - 设置分辨率
Source:
  - stream/screen.js, line 103

设置分辨率

#### setResolution

Description:
  - 设置分辨率
Source:
  - stream/screen.js, line 103

设置分辨率

#### setScreenAudioEnabled

Description:
  - 屏幕共享时是否同时共享屏幕音频
Source:
  - stream/screen.js, line 864

屏幕共享时是否同时共享屏幕音频

#### setScreenAudioEnabled

Description:
  - 屏幕共享时是否同时共享屏幕音频
Source:
  - stream/screen.js, line 864

屏幕共享时是否同时共享屏幕音频

#### (async) subscrible

Description:
  - 订阅桌面共享流
Source:
  - stream/screen.js, line 485

订阅桌面共享流

#### (async) subscrible

Description:
  - 订阅桌面共享流
Source:
  - stream/screen.js, line 485

订阅桌面共享流

#### unmuteScreenAudio

Description:
  - 取消屏幕共享静音
Source:
  - stream/screen.js, line 881

取消屏幕共享静音

#### unmuteScreenAudio

Description:
  - 取消屏幕共享静音
Source:
  - stream/screen.js, line 881

取消屏幕共享静音

#### (async) unpublish

Source:
  - stream/screen.js, line 422

#### (async) unpublish

Source:
  - stream/screen.js, line 422

#### (async) unsubscrible

Description:
  - 取消订阅桌面共享流
Source:
  - stream/screen.js, line 529

取消订阅桌面共享流

#### (async) unsubscrible

Description:
  - 取消订阅桌面共享流
Source:
  - stream/screen.js, line 529

取消订阅桌面共享流

#### updateScreenData

Description:
  - 桌面共享数据更改
Source:
  - stream/screen.js, line 661

桌面共享数据更改

#### updateScreenData

Description:
  - 桌面共享数据更改
Source:
  - stream/screen.js, line 661

桌面共享数据更改