Skip to main content

DesktopCapturerSource Object

  • id string - The identifier of a window or screen that can be used as a chromeMediaSourceId constraint when calling [navigator.webkitGetUserMedia]. 调用[navigator.webkitGetUserMedia]时可用作chromeMediaSourceId约束的窗口或屏幕的标识符。The format of the identifier will be window:XX:YY or screen:ZZ:0. 标识符的格式将是window:XX:YYscreen:ZZ:0XX is the windowID/handle. XX是窗口ID/句柄。YY is 1 for the current process, and 0 for all others. YY对于当前进程为1,对于所有其他进程为0。ZZ is a sequential number that represents the screen, and it does not equal to the index in the source's name.ZZ是一个表示屏幕的序列号,它不等于源名称中的索引。
  • name string - A screen source will be named either Entire Screen or Screen <index>, while the name of a window source will match the window title.屏幕源将被命名为Entire ScreenScreen <index>,而窗口源的名称将与窗口标题相匹配。
  • thumbnail NativeImage - A thumbnail image. 缩略图。Note: There is no guarantee that the size of the thumbnail is the same as the thumbnailSize specified in the options passed to desktopCapturer.getSources. 无法保证缩略图的大小与传递给desktopCapturer.getSourcesoptions中指定的thumbnailSize相同。The actual size depends on the scale of the screen or window.实际大小取决于屏幕或窗口的比例。
  • display_id string - A unique identifier that will correspond to the id of the matching Display returned by the Screen API. Screen API返回的匹配Displayid相对应的唯一标识符。On some platforms, this is equivalent to the XX portion of the id field above and on others it will differ. 在某些平台上,这相当于上面id字段的XX部分,而在其他平台上则有所不同。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. 拥有窗口的应用程序的图标图像,如果源具有类型屏幕,则为nullThe size of the icon is not known in advance and depends on what the application provides.图标的大小事先不知道,并且取决于应用程序提供的内容。