Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

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

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.

  • No labels