feat: add support for DesktopCapturerSource.appIcon

Useful to get the icon of the application owning the source.
Only available for sources of type window, i.e. not for screen.

https://github.com/electron/electron/issues/14845
This commit is contained in:
Julien Isorce 2018-12-03 22:42:49 -08:00 committed by Cheng Zhao
parent 77f73830e8
commit 1f55f1635f
7 changed files with 48 additions and 15 deletions

View file

@ -84,6 +84,9 @@ The `desktopCapturer` module has the following methods:
to be captured, available types are `screen` and `window`.
* `thumbnailSize` [Size](structures/size.md) (optional) - The size that the media source thumbnail
should be scaled to. Default is `150` x `150`.
* `fetchWindowIcons` Boolean (optional) - Set to true to enable fetching window icons. The default
value is false. When false the appIcon property of the sources return null. Same if a source has
the type screen.
* `callback` Function
* `error` Error
* `sources` [DesktopCapturerSource[]](structures/desktop-capturer-source.md)

View file

@ -17,3 +17,7 @@
On some platforms, this is equivalent to the `XX` portion of the `id` field
above and on others it will differ. It will be an empty string if not
available.
* `appIcon` [NativeImage](../native-image.md) - 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.