Class MediaTrackSettings
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
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(MediaTrackConstraints), and will adhere to the default constraints for any properties whose constraints haven't been changed, or whose customized constraints couldn't be matched.
[ToObject]
public class MediaTrackSettings
- Inheritance
-
MediaTrackSettings
- Inherited Members
Remarks
To learn more about how constraints and settings work, see Capabilities, constraints, and settings.
-GetUserMedia(MediaStreamConstraints)
-GetDisplayMedia(DisplayMediaStreamOptions)
-GetConstraints()
-ApplyConstraints(MediaTrackConstraints)
-GetSettings()
Constructors
MediaTrackSettings()
public MediaTrackSettings()
Fields
AspectRatio
The MediaTrackSettings dictionary's aspectRatio property is a double-precision floating-point number indicating the {{glossary("aspect ratio")}} of the MediaStreamTrack as currently configured.
This lets you determine what value was selected to comply with your specified constraints for this property's value as described in the MediaTrackConstraints.AspectRatio property you provided when calling either GetUserMedia(MediaStreamConstraints) or ApplyConstraints(MediaTrackConstraints).
[Value("aspectRatio")]
public Number AspectRatio
Field Value
- Number
A double-precision floating-point number indicating the current configuration of the
track's aspect ratio. The aspect ratio is computed by taking the track's width, dividing
by its height, and rounding the result to ten decimal places. For example, the standard
16:9 high-definition aspect ratio can be computed as 1920/1080, or 1.7777777778.
Remarks
If needed, you can determine whether or not this constraint is supported by checking
the value of AspectRatio as returned by a
call to GetSupportedConstraints(). However, typically this
is unnecessary since browsers will ignore any constraints they're unfamiliar with.
-Media Capture and Streams API
-Capabilities, constraints, and settings
-MediaTrackConstraints.AspectRatio
-MediaTrackSettings
AutoGainControl
The MediaTrackSettings dictionary'sautoGainControl property is a Boolean value whose value
indicates whether or not automatic gain control (AGC) is enabled on an audio track. This
lets you determine what value was selected to comply with your specified constraints for
this property's value as described in the
MediaTrackConstraints.AutoGainControl property you provided when calling
either GetUserMedia(MediaStreamConstraints) or
ApplyConstraints(MediaTrackConstraints).
[Value("autoGainControl")]
public bool AutoGainControl
Field Value
- bool
A Boolean value which is
trueif the track has automatic gain control
enabled orfalseif AGC is disabled.
Remarks
Automatic gain control is a feature in which a sound source automatically manages
changes in the volume of its source media to maintain a steady overall volume level.
This feature is typically used on microphones, although it can be provided by other
input sources as well.
If needed, you can determine whether or not this constraint is supported by checking
the value of AutoGainControl as returned
by a call to GetSupportedConstraints(). However, typically
this is unnecessary since browsers will ignore any constraints they're unfamiliar with.
-Media Capture and Streams API
-Capabilities, constraints, and settings
-MediaTrackConstraints.AutoGainControl
-MediaTrackSupportedConstraints
BackgroundBlur
[Value("backgroundBlur")]
public bool BackgroundBlur
Field Value
Brightness
[Value("brightness")]
public Number Brightness
Field Value
ChannelCount
The MediaTrackSettings dictionary'schannelCount property is an integer indicating how many
audio channels the MediaStreamTrack is currently configured to have. This
lets you determine what value was selected to comply with your specified constraints for
this property's value as described in the
MediaTrackConstraints.ChannelCount property you provided when calling
either GetUserMedia(MediaStreamConstraints) or
ApplyConstraints(MediaTrackConstraints).
[Value("channelCount")]
public ulong ChannelCount
Field Value
- ulong
An integer value indicating the number of audio channels on the track. A value of 1
indicates monaural sound, 2 means stereo, and so forth.
Remarks
If needed, you can determine whether or not this constraint is supported by checking
the value of ChannelCount as returned by a
call to GetSupportedConstraints(). However, typically this
is unnecessary since browsers will ignore any constraints they're unfamiliar with.
-Media Capture and Streams API
-Capabilities, constraints, and settings
-MediaTrackConstraints.ChannelCount
-MediaTrackSettings
ColorTemperature
[Value("colorTemperature")]
public Number ColorTemperature
Field Value
Contrast
[Value("contrast")]
public Number Contrast
Field Value
Cursor
The MediaTrackSettings dictionary's cursor property indicates whether or not the cursor should be captured as part of the video track included in the MediaStream returned by GetDisplayMedia(DisplayMediaStreamOptions).
[Value("cursor")]
public string Cursor
Field Value
- string
The value of
cursorcomes from theCursorCaptureConstraintenumerated string type, and may have one of the following values:
Remarks
-Screen Capture API
-Using the screen capture API
-Capabilities, constraints, and settings
-GetDisplayMedia(DisplayMediaStreamOptions)
-GetConstraints()
-ApplyConstraints(MediaTrackConstraints)
-GetSettings()
DeviceId
The MediaTrackSettings dictionary'sdeviceId property is a string which
uniquely identifies the source for the corresponding MediaStreamTrack for
the origin corresponding to the browsing session. This lets you determine what value was
selected to comply with your specified constraints for this property's value as
described in the MediaTrackConstraints.DeviceId property you provided
when calling either GetUserMedia(MediaStreamConstraints).
[Value("deviceId")]
public string DeviceId
Field Value
- string
A string whose value is an origin-unique identifier for the track's
source. This ID is valid across multiple browsing sessions for the same origin and is
guaranteed to be different for all other origins, so you can safely use it to request
the same source be used for multiple sessions, for example.The actual value of the string, however, is determined by the source of the track, and
there is no guarantee what form it will take, although the specification does recommend
it be a GUID.Since there is a one-to-one pairing of ID with each source, all tracks with the same
source will share the same ID for any given origin, so
GetCapabilities() will always return exactly one value
fordeviceId. That makes the device ID not useful for any changes to
constraints when calling ApplyConstraints(MediaTrackConstraints).NOTE
An exception to the rule that device IDs are the same across browsing sessions:
private browsing mode will use a different ID, and will change it each browsing
session.
Remarks
If needed, you can determine whether or not this constraint is supported by checking
the value of DeviceId as returned by a
call to GetSupportedConstraints(). However, typically this
is unnecessary since browsers will ignore any constraints they're unfamiliar with.
Because RTP doesn't include this information, tracks associated with a
WebRTC RTCPeerConnection
will never include this property.
-Media Capture and Streams API
-Capabilities, constraints, and settings
-GroupId
-MediaTrackConstraints.DeviceId
-MediaTrackSettings
DisplaySurface
The MediaTrackSettings dictionary'sdisplaySurface property indicates the type of display
surface being captured.
[Value("displaySurface")]
public string DisplaySurface
Field Value
- string
The value of
displaySurfaceis a string that comes from theDisplayCaptureSurfaceTypeenumerated type, and is one of the following:Not all user agents support all of these surface types.
Remarks
-Screen Capture API
-Using the screen capture API
-Capabilities, constraints, and settings
-GetDisplayMedia(DisplayMediaStreamOptions)
-GetConstraints()
-ApplyConstraints(MediaTrackConstraints)
-GetSettings()
EchoCancellation
The MediaTrackSettings dictionary'sechoCancellation property is a Boolean value whose value
indicates whether or not echo cancellation is enabled on an audio track. This lets you
determine what value was selected to comply with your specified constraints for this
property's value as described in the
MediaTrackConstraints.EchoCancellation property you provided when calling
either GetUserMedia(MediaStreamConstraints) or
ApplyConstraints(MediaTrackConstraints).
[Value("echoCancellation")]
public bool EchoCancellation
Field Value
- bool
A Boolean value which is
trueif the track has echo cancellation
functionality enabled orfalseif echo cancellation is disabled.
Remarks
Echo cancellation is a feature which attempts to prevent echo effects on a two-way
audio connection by attempting to reduce or eliminate crosstalk between the user's
output device and their input device. For example, it might apply a filter that negates
the sound being produced on the speakers from being included in the input track
generated from the microphone.
If needed, you can determine whether or not this constraint is supported by checking
the value of EchoCancellation as returned
by a call to GetSupportedConstraints(). However, typically
this is unnecessary since browsers will ignore any constraints they're unfamiliar with.
Because RTP doesn't include this information, tracks associated with a
WebRTC RTCPeerConnection
will never include this property.
-Media Capture and Streams API
-Capabilities, constraints, and settings
-MediaTrackConstraints.EchoCancellation
-MediaTrackSettings
ExposureCompensation
[Value("exposureCompensation")]
public Number ExposureCompensation
Field Value
ExposureMode
[Value("exposureMode")]
public string ExposureMode
Field Value
ExposureTime
[Value("exposureTime")]
public Number ExposureTime
Field Value
FacingMode
The MediaTrackSettings dictionary'sfacingMode property is a string
indicating the direction in which the camera producing the video track represented by
the MediaStreamTrack is currently facing. This lets you determine what
value was selected to comply with your specified constraints for this property's value
as described in the MediaTrackConstraints.FacingMode property you
provided when calling either GetUserMedia(MediaStreamConstraints)
or ApplyConstraints(MediaTrackConstraints).
[Value("facingMode")]
public string FacingMode
Field Value
- string
A string whose value is one of the strings in
VideoFacingModeEnum.
Remarks
If needed, you can determine whether or not this constraint is supported by checking
the value of FacingMode as returned by a
call to GetSupportedConstraints(). However, typically this
is unnecessary since browsers will ignore any constraints they're unfamiliar with.
Because RTP doesn't include this information, tracks associated with a
WebRTC RTCPeerConnection
will never include this property.
-Media Capture and Streams API
-Capabilities, constraints, and settings
-MediaTrackConstraints.FacingMode
-MediaTrackSettings
FocusDistance
[Value("focusDistance")]
public Number FocusDistance
Field Value
FocusMode
[Value("focusMode")]
public string FocusMode
Field Value
FrameRate
The MediaTrackSettings dictionary'sframeRate property is a double-precision floating-point
number indicating the frame rate, in frames per second, of the
MediaStreamTrack as currently configured. This lets you determine what
value was selected to comply with your specified constraints for this property's value
as described in the MediaTrackConstraints.FrameRate property you provided
when calling either GetUserMedia(MediaStreamConstraints) or
ApplyConstraints(MediaTrackConstraints).
[Value("frameRate")]
public Number FrameRate
Field Value
- Number
A double-precision floating-point number indicating the current configuration of the
track's frame rate, in frames per second.
Remarks
If needed, you can determine whether or not this constraint is supported by checking
the value of FrameRate as returned by a
call to GetSupportedConstraints(). However, typically this
is unnecessary since browsers will ignore any constraints they're unfamiliar with.
-Media Capture and Streams API
-Capabilities, constraints, and settings
-MediaTrackConstraints.FrameRate
-MediaTrackSettings
GroupId
The MediaTrackSettings dictionary'sgroupId property is a browsing-session unique
string which identifies the group of devices which includes the source
for the MediaStreamTrack. This lets you determine what value was selected
to comply with your specified constraints for this property's value as described in the
MediaTrackConstraints.GroupId property you provided when calling either
GetUserMedia(MediaStreamConstraints).
[Value("groupId")]
public string GroupId
Field Value
- string
A string whose value is a browsing-session unique identifier for a
group of devices which includes the source of the track's contents. Two devices share
the same group ID if they belong to the same physical hardware device. For example, a
headset has two devices on it: a microphone which can serve as a source for audio tracks
and a speaker which can serve as an output for audio.The group ID is not usable across multiple browsing sessions. However, it can be used
to ensure that audio input and output are both being performed on the same headset, for
example, or to ensure that the built-in camera and microphone on a phone are being used
for video conferencing purposes.The actual value of the string, however, is determined by the source of the track, and
there is no guarantee what form it will take, although the specification does recommend
it be a GUID.Since this property isn't stable across browsing sessions, its usefulness when calling
GetUserMedia(MediaStreamConstraints) is generally limited to
ensuring that tasks performed during the same browsing session use devices from the same
group (or that they don't use devices from the same group). There is no situation in
which the groupId is useful when callingapplyConstraints(), since the
value can't be changed.
Remarks
If needed, you can determine whether or not this constraint is supported by checking
the value of GroupId as returned by a call
to GetSupportedConstraints(). However, typically this is
unnecessary since browsers will ignore any constraints they're unfamiliar with.
Because RTP doesn't include this information, tracks associated with a
WebRTC RTCPeerConnection
will never include this property.
-Media Capture and Streams API
-Capabilities, constraints, and settings
-DeviceId
-MediaTrackConstraints.GroupId
-MediaTrackSettings
Height
The MediaTrackSettings dictionary's height
property is an integer indicating the number of pixels tall
MediaStreamTrack is currently configured to be. This lets you determine
what value was selected to comply with your specified constraints for this property's
value as described in the MediaTrackConstraints.Height property you
provided when calling either GetUserMedia(MediaStreamConstraints)
or ApplyConstraints(MediaTrackConstraints).
[Value("height")]
public ulong Height
Field Value
- ulong
An integer value indicating the height, in pixels, of the video track as currently
configured.
Remarks
If needed, you can determine whether or not this constraint is supported by checking
the value of Height as returned by a call
to GetSupportedConstraints(). However, typically this is
unnecessary since browsers will ignore any constraints they're unfamiliar with.
-Media Capture and Streams API
-Capabilities, constraints, and settings
-MediaTrackConstraints.Height
-MediaTrackSettings
Iso
[Value("iso")]
public Number Iso
Field Value
Latency
The MediaTrackSettings dictionary'slatency property is a double-precision floating-point
number indicating the estimated latency (specified in seconds) of the
MediaStreamTrack as currently configured. This lets you determine what
value was selected to comply with your specified constraints for this property's value
as described in the MediaTrackConstraints.Latency property you provided
when calling either GetUserMedia(MediaStreamConstraints) or
ApplyConstraints(MediaTrackConstraints).
[Value("latency")]
public Number Latency
Field Value
- Number
A double-precision floating-point number indicating the estimated latency, in seconds,
of the audio track as currently configured.
Remarks
This is, of course, an approximation, since latency can vary for many reasons including
CPU, transmission, and storage overhead.
If needed, you can determine whether or not this constraint is supported by checking
the value of Latency as returned by a call
to GetSupportedConstraints(). However, typically this is
unnecessary since browsers will ignore any constraints they're unfamiliar with.
Because RTP doesn't include this information, tracks associated with a
WebRTC RTCPeerConnection
will never include this property.
-Media Capture and Streams API
-Capabilities, constraints, and settings
-MediaTrackConstraints.Latency
-MediaTrackSettings
LogicalSurface
The MediaTrackSettings dictionary'slogicalSurface property indicates whether or not the
display area being captured is a logical surface. Logical surfaces are those which are
not necessarily entirely onscreen, or may even be off-screen, such as windows' backing
buffers (where only part of the buffer is visible without scrolling the containing
window) and offscreen rendering contexts.
[Value("logicalSurface")]
public bool LogicalSurface
Field Value
- bool
A Boolean value which is
trueif the video track in the stream of captured
video is taken from a logical display surface.The most common scenario in which a display surface may be a logical one is if the
selected surface contains the entire content area of a window which is too large to
display onscreen at once. Since the window that contains the surface has to be scrolled
to show the rest of the contents, the surface is a logical one.A visible display surface (that is, a surface for whichlogicalSurface
returnsfalse) is the portion of a logical display surface which is
currently visible onscreen.For example, a user agent may choose to allow the user to choose whether to
share the entire document (abrowserwithlogicalSurfacevalue
oftrue), or just the currently visible portion of the document (where thelogicalSurfaceof thebrowsersurface isfalse).
Remarks
-Screen Capture API
-Using the screen capture API
-Capabilities, constraints, and settings
-GetDisplayMedia(DisplayMediaStreamOptions)
-GetConstraints()
-ApplyConstraints(MediaTrackConstraints)
-GetSettings()
NoiseSuppression
The MediaTrackSettings dictionary'snoiseSuppression property is a Boolean value whose value
indicates whether or not noise suppression technology is enabled on an audio track. This
lets you determine what value was selected to comply with your specified constraints for
this property's value as described in the
MediaTrackConstraints.NoiseSuppression property you provided when calling
either GetUserMedia(MediaStreamConstraints) or
ApplyConstraints(MediaTrackConstraints).
[Value("noiseSuppression")]
public bool NoiseSuppression
Field Value
- bool
A Boolean value which is
trueif the input track has noise suppression
enabled orfalseif AGC is disabled.
Remarks
Noise suppression automatically filters the audio to remove background noise, hum
caused by equipment, and the like from the sound before delivering it to your code. This
feature is typically used on microphones, although it is technically possible it could
be provided by other input sources as well.
If needed, you can determine whether or not this constraint is supported by checking
the value of NoiseSuppression as returned
by a call to GetSupportedConstraints(). However, typically
this is unnecessary since browsers will ignore any constraints they're unfamiliar with.
-Media Capture and Streams API
-Capabilities, constraints, and settings
-MediaTrackConstraints.NoiseSuppression
-MediaTrackSupportedConstraints
Pan
[Value("pan")]
public Number Pan
Field Value
PointsOfInterest
[Value("pointsOfInterest")]
public List<Point2D> PointsOfInterest
Field Value
ResizeMode
[Value("resizeMode")]
public string ResizeMode
Field Value
RestrictOwnAudio
[Value("restrictOwnAudio")]
public bool RestrictOwnAudio
Field Value
SampleRate
The MediaTrackSettings dictionary'ssampleRate property is an integer indicating how many
audio samples per second the MediaStreamTrack is currently configured
for. This lets you determine what value was selected to comply with your specified
constraints for this property's value as described in the
MediaTrackConstraints.SampleRate property you provided when calling
either GetUserMedia(MediaStreamConstraints) or
ApplyConstraints(MediaTrackConstraints).
[Value("sampleRate")]
public ulong SampleRate
Field Value
- ulong
An integer value indicating how many samples each second of audio data includes. Common
values include 44,100 (standard CD audio), 48,000 (standard digital audio), 96,000
(commonly used in audio mastering and post-production), and 192,000 (used for
high-resolution audio in professional recording and mastering sessions). However, lower
values are often used to reduce bandwidth requirements; 8,000 samples per second is
adequate for comprehensible albeit imperfect human speech, and both 11,025 FPS and
22,050 FPS are often used for low-bandwidth, reduced quality sound and music.
Remarks
If needed, you can determine whether or not this constraint is supported by checking
the value of SampleRate as returned by a
call to GetSupportedConstraints(). However, typically this
is unnecessary since browsers will ignore any constraints they're unfamiliar with.
-Media Capture and Streams API
-Capabilities, constraints, and settings
-MediaTrackConstraints.SampleRate
-MediaTrackSettings
SampleSize
The MediaTrackSettings dictionary'ssampleSize property is an integer indicating the linear
sample size (in bits per sample) the MediaStreamTrack is currently
configured for. This lets you determine what value was selected to comply with your
specified constraints for this property's value as described in the
MediaTrackConstraints.SampleSize property you provided when calling
either GetUserMedia(MediaStreamConstraints) or
ApplyConstraints(MediaTrackConstraints).
[Value("sampleSize")]
public ulong SampleSize
Field Value
- ulong
An integer value indicating how many bits each audio sample is represented by. The most
commonly used sample size for many years now is 16 bits per sample, which was used for
CD audio among others. Other common sample sizes are 8 (for reduced bandwidth
requirements) and 24 (for high-resolution professional audio).Each audio channel on the track requires sampleSize bits.
That means that a given sample actually uses (sampleSize/ 8) * ChannelCount bytes of data.
For example, 16-bit stereo audio requires (16/8)*2 or 4 bytes per sample.
Remarks
If needed, you can determine whether or not this constraint is supported by checking
the value of SampleSize as returned by a
call to GetSupportedConstraints(). However, typically this
is unnecessary since browsers will ignore any constraints they're unfamiliar with.
-Media Capture and Streams API
-Capabilities, constraints, and settings
-MediaTrackConstraints.SampleSize
-MediaTrackSettings
Saturation
[Value("saturation")]
public Number Saturation
Field Value
Sharpness
[Value("sharpness")]
public Number Sharpness
Field Value
SuppressLocalAudioPlayback
NOTE
ExperimentalsuppressLocalAudioPlayback property controls whether the audio playing in a tab will continue to be played out of a user's local speakers when the tab is captured.
[Value("suppressLocalAudioPlayback")]
public bool SuppressLocalAudioPlayback
Field Value
- bool
The value of
suppressLocalAudioPlaybackis a boolean —trueenables local audio playback suppression, andfalsedisables it.
Remarks
For example, in cases where you broadcast a video call to an external AV system in a conference room, you will want the audio to play out of the AV system, and not the local speakers. This way, the audio will be louder and clearer, and also in sync with the conference video.
-Screen Capture API
-Using the screen capture API
-Capabilities, constraints, and settings
-GetDisplayMedia(DisplayMediaStreamOptions)
-GetConstraints()
-ApplyConstraints(MediaTrackConstraints)
-GetSettings()
Tilt
[Value("tilt")]
public Number Tilt
Field Value
Torch
[Value("torch")]
public bool Torch
Field Value
WhiteBalanceMode
[Value("whiteBalanceMode")]
public string WhiteBalanceMode
Field Value
Width
The MediaTrackSettings dictionary's width
property is an integer indicating the number of pixels wide
MediaStreamTrack is currently configured to be. This lets you determine
what value was selected to comply with your specified constraints for this property's
value as described in the MediaTrackConstraints.Width property you
provided when calling either GetUserMedia(MediaStreamConstraints)
or ApplyConstraints(MediaTrackConstraints).
[Value("width")]
public ulong Width
Field Value
- ulong
An integer value indicating the width, in pixels, of the video track as currently configured.
Remarks
If needed, you can determine whether or not this constraint is supported by checking
the value of Width as returned by a call
to GetSupportedConstraints(). However, typically this is
unnecessary since browsers will ignore any constraints they're unfamiliar with.
-Media Capture and Streams API
-Capabilities, constraints, and settings
-MediaTrackConstraints.Width
-MediaTrackSettings
Zoom
[Value("zoom")]
public Number Zoom