The MediaTrackSupportedConstraints dictionary's logicalSurface property indicates whether or not the logicalSurface constraint is supported by the user agent and the device on which the content is being used.

The supported constraints list is obtained by calling navigator.mediaDevices.getSupportedConstraints().


isLogicalSurfaceSupported = supportedConstraints.logicalSurface;


A Boolean value which is true if the logicalSurface constraint is supported by the device and user agent.


This method sets up the constraints object specifying the options for the call to getDisplayMedia(). It adds the logicalSurface constraint (requesting that only logical display surfaces—those which may not be entirely visible onscreen—be included among the options available to the user) only if it is known to be supported by the browser. Capturing is then started by calling getDisplayMedia() and attaching the returned stream to the video element referenced by the variable videoElem.

async function capture() {
  let supportedConstraints = navigator.mediaDevices.getSupportedConstraints();
  let displayMediaOptions = {
    video: {
    audio: false;

  if (supportedConstraints.logicalSurface) { = "monitor";

  try {
    videoElem.srcObject = await navigator.mediaDevices.getDisplayMedia(displayMediaOptions);
  } catch(err) {
    /* handle the error */


Specification Status Comment
The definition of 'MediaTrackSupportedConstraints.logicalSurface' in that specification.
Unknown Initial definition

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
logicalSurfaceChrome No support NoEdge ? Firefox No support NoIE No support NoOpera Full support YesSafari ? WebView Android No support NoChrome Android No support NoEdge Mobile ? Firefox Android No support NoOpera Android ? Safari iOS ? Samsung Internet Android ?


Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown

See also

Document Tags and Contributors

Contributors to this page: mdnwebdocs-bot, Sheppy
Last updated by: mdnwebdocs-bot,