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.
| Event | Description |
|---|---|
| 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.
| Method | Description |
|---|---|
| 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:
| Property | Value | Description |
|---|---|---|
| sourceType | sourceTypeEnum | The type of the source of the MediaStreamTrack: "camera" or "microphone". |
| deviceId | string | The identifier for the source of the MediaStreamTrack. |
| groupId | string | The group identifier for the source of the MediaStreamTrack. |
The following constrainable properties apply only to video MediaStreamTrack objects:
| Property | Value | Description |
|---|---|---|
| width | ConstrainLong | In pixels, the width or width range. |
| height | ConstrainLong | In pixels, the height or height range. |
| frameRate | ConstrainDouble | The frame rate, in frames per second, or frame rate range. |
| aspectRatio | ConstrainDouble | The 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. |
| facingMode | ConstrainDOMString | From 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:
| Property | Value | Description |
|---|---|---|
| volume | ConstrainDouble | The volume or volume range. A volume of 0.0 is silent and a volume of 1.0 is the maximum supported volume. |
| sampleRate | ConstrainLong | In samples per second, the sample ratefor the audio data. |
| sampleSize | ConstrainDouble | The linear sample size in bits. |