The ConstrainLong
type is used to specify a constraint for a property whose value is an integral number. It extends the {{domxref("LongRange")}} dictionary (which provides the ability to specify a permitted range of property values) to also support an exact value and/or an ideal value the property should take on. In addition, you can specify the value as a simple long integer value.
Properties
If the value of a ConstrainLong
is an object rather than a number, it may have the properties below in addition to the properties it inherits from {{domxref("LongRange")}}.
exact
- An integer specifying precise, required, value the property must have to be considered acceptable.
ideal
- An integer specifying a value the property would ideally have, but which can be considered optional if necessary to find a match.
Specifications
Specification | Status | Comment |
---|---|---|
{{SpecName('Media Capture', '#idl-def-ConstrainLong', 'ConstrainLong')}} | {{Spec2('Media Capture')}} | Initial definition |
Technically, ConstrainLong
is actually based on an intermediary dictionary named ConstrainLongRange
, which adds exact
and ideal
to {{domxref("LongRange")}}, with ConstrainLong
being a type that can be either a long integer or a LongRange
. However, for the sake of documentation clarity, the intermediate type (present only because of quirks in {{Glossary("WebIDL")}} syntax) is ignored here.
Browser compatibility
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Microsoft Edge | Opera | Safari (WebKit) |
---|---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{CompatGeckoDesktop(50)}} | {{CompatNo}} | {{CompatUnknown}} | {{CompatNo}} | {{CompatUnknown}} |
Feature | Android | Android Webview | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|
Basic support | {{CompatUnknown}} | {{CompatVersionUnknown}} | {{CompatGeckoMobile(50)}} | {{CompatNo}} | {{CompatNo}} | {{CompatUnknown}} | {{CompatVersionUnknown}} |
See also
- Media Capture and Streams API
- Capabilities, constraints, and settings
- {{domxref("LongRange")}}
- {{domxref("MediaTrackConstraints")}}
- {{domxref("MediaTrackCapabilities")}}
- {{domxref("MediaTrackSupportedConstraints")}}