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.
Properties
Some or all of the following will be included in the object.
Properties of all media tracks
- deviceId
- A DOMStringindicating the current value of thedeviceIdMediaDevices.getUserMedia().
- groupId
- A DOMStringindicating the current value of thegroupIddeviceId) are considered part of the same group if they are from the same physical device. For instance, the audio input and output devices for the speaker and microphone built into a phone would share the same group ID, since they're part of the same physical device. The microphone on a headset would have a different ID, though. This value is specific to the source of the track's data and is not usable for setting constraints; it can, however, be used for initially selecting media when callingMediaDevices.getUserMedia().
Properties of audio tracks
- channelCount
- A long integer value indicating the current value of the channelCount
- echoCancellation
- A Boolean indicating the current value of the echoCancellationtrueif echo cancellation is enabled, otherwisefalse.
- latency
- A double-precision floating point value indicating the current value of the latency
- sampleRate
- A long integer value indicating the current value of the sampleRate
- sampleSize
- A long integer value indicating the current value of the sampleSize
- volume
- A double-precision floating point value indicating the current value of the volume
Properties of video tracks
- aspectRatio
- A double-precision floating point value indicating the current value of the aspectRatio
- facingMode
- A DOMStringindicating the current value of thefacingMode- "user"
- A camera facing the user (commonly known as a "selfie cam"), used for self-portraiture and video calling.
- "environment"
- A camera facing away from the user (when the user is looking at the screen). This is typically the highest quality camera on the device, used for general photography.
- "left"
- A camera facing toward the environment to the user's left.
- "right"
- A camera facing toward the environment to the user's right.
 
- frameRate
- A double-precision floating point value indicating the current value of the frameRate
- height
- A long integer value indicating the current value of the height
- width
- A long integer value indicating the current value of the widthproperty, specifying the width of the track's video data in pixels.