DesktopCapturerSource 对象
优质
小牛编辑
169浏览
2023-12-01
id
String - 一个 window 或 screen 的标识符,在调用 [navigator. webkitGetUserMedia
] 时可作为chromeMediaSourceId
约束,。 标识符的格式是:window:XX
或者screen:XX
,XX
是一个随机生成的数字name
字符串--screen源将被命名为Entire Screen
或Screen<index>
, 而window源的名称将与window标题匹配。thumbnail
NativeImage - 缩略图图像。 注意: 无法保证缩略图的大小与传递给desktopCapturer. getSources
的options
中指定的thumbnailSize
相同。 实际尺寸取决于 screen 或 window 的比例。display_id
String - 一个由 Screen API 返回的与 Display 的id
对应匹配的唯一标识符。 在某些平台上,这相当于上面id
字段中的XX
部分,其他平台则有所不同。 它在不可用时将会是一个空字符串。appIcon
NativeImage - 可能是带有 window 的应用的图标, 或者 srouce 有一个 type screen 时null。 图标尺寸无法事先知道,它取决于提供的应用。
DesktopCapturerSource Object
id
String - The identifier of a window or screen that can be used as achromeMediaSourceId
constraint when calling
[navigator.webkitGetUserMedia
]. The format of the identifier will bewindow:XX
orscreen:XX
, whereXX
is a random generated number.name
String - A screen source will be named eitherEntire Screen
orScreen <index>
, while the name of a window source will match the window
title.thumbnail
NativeImage - A thumbnail image. Note:
There is no guarantee that the size of the thumbnail is the same as thethumbnailSize
specified in theoptions
passed todesktopCapturer.getSources
. The actual size depends on the scale of the
screen or window.display_id
String - A unique identifier that will correspond to theid
of
the matching Display returned by the Screen API.
On some platforms, this is equivalent to theXX
portion of theid
field
above and on others it will differ. It will be an empty string if not
available.appIcon
NativeImage - An icon image of the
application that owns the window or null if the source has a type screen.
The size of the icon is not known in advance and depends on what the
the application provides.