ConstrainablePattern object

This interface allows applications to inspect and adjust the properties of objects implementing it.

Members

The ConstrainablePattern object has these types of members:

Events

The ConstrainablePattern object has these events.

EventDescription
onoverconstrained

This event is fired when the browser is no longer able to satisfy the constraints after a new constraint has been added.

 

Methods

The ConstrainablePattern object has these methods.

MethodDescription
applyConstraints

Applies constraints to the MediaStreamTrack object.

getCapabilities

Returns the dictionary of the names of the containable properties that the object supports.

getConstraints

Returns the constraints that were set by the applyConstraints method.

getSettings

Returns the settings of a MediaStreamTrack object.

 

Remarks

The following constrainable properties apply to both video and audio MediaStreamTrack objects:

PropertyValueDescription
sourceTypesourceTypeEnumThe type of the source of the MediaStreamTrack: "camera" or "microphone".
deviceIdstringThe identifier for the source of the MediaStreamTrack.
groupIdstringThe group identifier for the source of the MediaStreamTrack.

 

The following constrainable properties apply only to video MediaStreamTrack objects:

PropertyValueDescription
widthConstrainLongIn pixels, the width or width range.
heightConstrainLongIn pixels, the height or height range.
frameRateConstrainDoubleThe frame rate, in frames per second, or frame rate range.
aspectRatioConstrainDoubleThe aspect ratio or aspect ratio range. This is represented as the width in pixels divided by height in pixels, rounded to the tenth decimal place.
facingModeConstrainDOMStringFrom the user's perspective, the directions that the camera can face: "user", "environment", "left", or "right".

 

The following constrainable properties apply only to audio MediaStreamTrack objects:

PropertyValueDescription
volumeConstrainDouble The volume or volume range. A volume of 0.0 is silent and a volume of 1.0 is the maximum supported volume.
sampleRateConstrainLongIn samples per second, the sample ratefor the audio data.
sampleSizeConstrainDoubleThe linear sample size in bits.

 

 

 

Show: