Type alias InitConstraints
InitConstraints: MediaStreamConstraints | ((supportedConstraints) => MediaStreamConstraints | Promise<MediaStreamConstraints>)
Type declaration
- (supportedConstraints): MediaStreamConstraints | Promise<MediaStreamConstraints>
Parameters
- supportedConstraints: MediaTrackSupportedConstraints
Returns MediaStreamConstraints | Promise<MediaStreamConstraints>
Media stream constraints for initialization.
This can either be a standard
MediaStreamConstraints
object or a function that returnsMediaStreamConstraints
. The function is provided with an argument,MediaTrackSupportedConstraints
, which represents constraints supported by the user agent, and should return eitherMediaStreamConstraints
or a promise that resolves to it.Note that
MediaTrackSupportedConstraints
doesn't reflect the constraints supported by the device. It only provides information about which constraint can be understood by the user agent.MediaStreamConstraints
MediaTrackSupportedConstraints