MediaCaptureDevice Class

A capture device of a MediaCaptureBackend: a camera, a microphone, an audio output or a display surface.

public sealed class MediaCaptureDevice

Constructors

NameDescription
MediaCaptureDevice()

MediaCaptureDevice()

MediaCaptureBackend.cs
  • Obsolete: Constructors of types with required members are not supported in this version of your compiler.
[Obsolete("Constructors of types with required members are not supported in this version of your compiler.", true)]
public MediaCaptureDevice()

No documentation is available.

Properties

NameDescription
CapabilitiesGets the capabilities of the device: the values or the ranges of values of its constrainable properties (e.g. facingMode, sampleRate, echoCancellation, zoom). The deviceId and the groupId are set by the library. For a device with MediaCaptureDevice.VideoModes, the width, height, aspectRatio and frameRate capabilities are computed from the modes.
DefaultSettingsGets the default settings of the device: the values of its constrainable properties that the constraints do not change (e.g. the native sample rate of a microphone, the facingMode of a camera). When several settings satisfy the constraints equally well, the closest to the default ones is selected.
GroupIdGets the identifier of the physical device that the device belongs to (e.g. the microphone and the speakers of a headset), or an empty string when the device is alone. The documents see their own identifiers, derived from it.
IdGets the identifier of the device in the backend. It must be unique among the devices of the same kind, and stable.
KindGets the kind of the device.
LabelGets the label of the device (e.g. External USB Webcam), or an empty string.
VideoModesGets the native video modes of a camera or a screen (its sizes and frame rates). The default mode is the one of MediaCaptureDevice.DefaultSettings (its width and height), else the first mode. Unless the resizeMode capability excludes crop-and-scale, the library also offers the smaller sizes and frame rates, cropped and scaled down from a native mode (https://w3c.github.io/mediacapture-main/#def-constraint-resizeMode).

Gets the capabilities of the device: the values or the ranges of values of its constrainable properties (e.g. facingMode, sampleRate, echoCancellation, zoom). The deviceId and the groupId are set by the library. For a device with MediaCaptureDevice.VideoModes, the width, height, aspectRatio and frameRate capabilities are computed from the modes.

public MediaTrackCapabilities Capabilities { get; init; }

DefaultSettings

MediaCaptureBackend.cs

Gets the default settings of the device: the values of its constrainable properties that the constraints do not change (e.g. the native sample rate of a microphone, the facingMode of a camera). When several settings satisfy the constraints equally well, the closest to the default ones is selected.

public MediaTrackSettings DefaultSettings { get; init; }

Property value

MediaTrackSettings

Gets the identifier of the physical device that the device belongs to (e.g. the microphone and the speakers of a headset), or an empty string when the device is alone. The documents see their own identifiers, derived from it.

public string GroupId { get; init; }

Property value

string

Gets the identifier of the device in the backend. It must be unique among the devices of the same kind, and stable.

public required string Id { get; init; }

Property value

string

Gets the kind of the device.

public required MediaDeviceKind Kind { get; init; }

Property value

MediaDeviceKind

Gets the label of the device (e.g. External USB Webcam), or an empty string.

public string Label { get; init; }

Property value

string

Gets the native video modes of a camera or a screen (its sizes and frame rates). The default mode is the one of MediaCaptureDevice.DefaultSettings (its width and height), else the first mode. Unless the resizeMode capability excludes crop-and-scale, the library also offers the smaller sizes and frame rates, cropped and scaled down from a native mode (https://w3c.github.io/mediacapture-main/#def-constraint-resizeMode).

public IReadOnlyList<MediaCaptureVideoMode> VideoModes { get; init; }

Methods

NameDescription
ToString()Returns a string that represents the current object.

Returns a string that represents the current object.

public override string ToString()

Returns

string A string that represents the current object.