The MediaTrackSettings
dictionary is used to return the current values configured for each of a MediaStreamTrack
's settings. These values will adhere as closely as possible to any constraints previously described using a MediaTrackConstraints
object and set using applyConstraints()
, and will adhere to the default constraints for any properties whose constraints haven't been changed, or whose customized constraints couldn't be matched.
To learn more about how constraints and settings work, see Capabilities, constraints, and settings.
Some or all of the following will be included in the object, either because it's not supported by the browser or because it's not available due to context. For example, because RTP doesn't provide some of these values during negotiation of a WebRTC connection, a track associated with a RTCPeerConnection
will not include certain values, such as facingMode
or groupId
.
Tracks containing video shared from a user's screen (regardless of whether the screen data comes from the entire screen or a portion of a screen, like a window or tab) are generally treated like video tracks, with the exception that they also support the following added settings:
-
cursor
-
A DOMString
which indicates whether or not the mouse cursor is being included in the generated stream and under what conditions. Possible values are:
-
always
-
The mouse is always visible in the video content of the {domxref("MediaStream"), unless the mouse has moved outside the area of the content.
-
motion
-
The mouse cursor is always included in the video if it's moving, and for a short time after it stops moving.
-
never
-
The mouse cursor is never included in the shared video.
-
displaySurface
-
A DOMString
which specifies the type of source the track contains; one of:
-
application
-
The stream contains all of the windows of the application chosen by the user rendered into the one video track.
-
browser
-
The stream contains the contents of a single browser tab selected by the user.
-
monitor
-
The stream's video track contains the entire contents of one or more of the user's screens.
-
window
-
The stream contains a single window selected by the user for sharing.
-
logicalSurface
-
A Boolean value which, if true
, indicates that the video contained in the stream's video track contains a background rendering context, rather than a user-visible one. This is false
if the video being captured is coming from a foreground (user-visible) source.