Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. MediaTrackConstraints
  4. logicalSurface

MediaTrackConstraints: logicalSurface property

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

TheMediaTrackConstraints dictionary'slogicalSurface property is aConstrainDOMString describing the requested or mandatory constraints placed upon the value of thelogicalSurface constrainable property.

This is used to specify whether ornotgetDisplayMedia() should allow theuser to choose display surfaces which are not necessarily fully visible on the screen,such as occluded windows or the complete content of windows which are large enough torequire scrolling to see their entire contents.

If needed, you can determine whether or not this constraint is supported by checkingthe value ofMediaTrackSupportedConstraints.logicalSurface as returned bya call toMediaDevices.getSupportedConstraints(). However, typically thisis unnecessary since browsers will ignore any constraints they're unfamiliar with.

Value

AConstrainBoolean which istrue if logical surfaces should be permitted among the selections available to the user.

Seehow constraints are defined.

Usage notes

You can check the setting selected by the user agent after the display media has beencreated bygetDisplayMedia() by callinggetSettings() on the display media'svideoMediaStreamTrack, then checking the value of the returnedMediaTrackSettings object'slogicalSurface object.

For example, if your app needs to know if the selected display surface is a logicalone:

js
let isLogicalSurface = displayStream  .getVideoTracks()[0]  .getSettings().logicalSurface;

Following this code,isLogicalSurface istrue if the displaysurface contained in the stream is a logical surface; that is, one which may not beentirely onscreen, or may even be entirely offscreen.

Specifications

Specification
Screen Capture
# dom-mediatrackconstraintset-logicalsurface

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp