getMediaSources API

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

ssf.getMediaSources(options, callback);
where options (Object) is:
  • types String[] - An array of Strings that lists the types of desktop sources to be captured, available types are screen and window.
  • thumbnailSize (optional) - { width: Number, height: number } The size that the media source thumbnail should be scaled to. Default is 150 x 150.
where callback (Function) has arguments:
  • error Error

  • Array of DesktopSource

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 be window:XX or screen:XX, where XX is a random generated number.

  • 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.

  • thumbnail (String) - Base64 encoded png image.

Need help? Email help@finos.org we'll get back to you.

Content on this page is licensed under the CC BY 4.0 license.
Code on this page is licensed under the Apache 2.0 license.