Purpose
In order to support screen sharing the client api needs enumerate screens and windows. This api provided a list of screens (each monitor) and list of windows available; providing title, id and thumbnail. This api is essentially equivalent of electron api: https://electron.atom.io/docs/api/desktop-capturer/#desktopcapturergetsourcesoptions-callback
getMediaSources API
Code Block |
---|
ssf.getMediaSources(options, callback); |
...
where DesktopSource (Object) is:
id (String) - The identifier of a window or screen that can be used as a
chromeMediaSourceId
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 either
Entire Screen
orScreen <index>
, while the name of a window source will match the window title.thumbnail (String) - Base64 encoded png image.