BooleanOrMediaTrackConstraints Struct

The (boolean or MediaTrackConstraints) union of the audio and video members of MediaStreamConstraints and DisplayMediaStreamOptions: whether the kind of media is requested, or the constraints of its track.

public readonly struct BooleanOrMediaTrackConstraints : IEquatable<BooleanOrMediaTrackConstraints>
Implements

Properties

NameDescription
ConstraintsGets the constraints when the union holds it, otherwise null.
FlagGets the boolean when the union holds it, otherwise null.
ValueGets the value of the union: Boolean or MediaTrackConstraints.

Gets the constraints when the union holds it, otherwise null.

public MediaTrackConstraints? Constraints { get; }

Gets the boolean when the union holds it, otherwise null.

public bool? Flag { get; }

Property value

bool?

Gets the value of the union: Boolean or MediaTrackConstraints.

public object Value { get; }

Property value

object

Methods

NameDescription
Equals(BooleanOrMediaTrackConstraints)Indicates whether the current object is equal to another object of the same type.
Equals(object?)Indicates whether this instance and a specified object are equal.
FromBoolean(bool)Creates the union from the boolean.
FromMediaTrackConstraints(MediaTrackConstraints)Creates the union from the constraints.
GetHashCode()Returns the hash code for this instance.

Equals overloads

Equals(BooleanOrMediaTrackConstraints)

MediaCaptureUnions.cs

Indicates whether the current object is equal to another object of the same type.

Parameters
other BooleanOrMediaTrackConstraints
An object to compare with this object.
Returns

bool true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

MediaCaptureUnions.cs

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)
Parameters
obj object?
The object to compare with the current instance.
Returns

bool true if obj and this instance are the same type and represent the same value; otherwise, false.

FromBoolean(bool)

MediaCaptureUnions.cs

Creates the union from the boolean.

public static BooleanOrMediaTrackConstraints FromBoolean(bool value)

Parameters

value bool

Returns

BooleanOrMediaTrackConstraints

FromMediaTrackConstraints(MediaTrackConstraints)

MediaCaptureUnions.cs

Creates the union from the constraints.

public static BooleanOrMediaTrackConstraints FromMediaTrackConstraints(MediaTrackConstraints value)

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int A 32-bit signed integer that is the hash code for this instance.

Operators

NameDescription
operator ==(BooleanOrMediaTrackConstraints, BooleanOrMediaTrackConstraints)Returns whether the two unions hold the same value.
implicit operator BooleanOrMediaTrackConstraints(MediaTrackConstraints)Creates the union from the constraints.
implicit operator BooleanOrMediaTrackConstraints(bool)Creates the union from the boolean.
operator !=(BooleanOrMediaTrackConstraints, BooleanOrMediaTrackConstraints)Returns whether the two unions hold different values.

operator ==(BooleanOrMediaTrackConstraints, BooleanOrMediaTrackConstraints)

MediaCaptureUnions.cs

Returns whether the two unions hold the same value.

op_Implicit overloads

implicit operator BooleanOrMediaTrackConstraints(MediaTrackConstraints)

MediaCaptureUnions.cs

Creates the union from the constraints.

public static implicit operator BooleanOrMediaTrackConstraints(MediaTrackConstraints value)

implicit operator BooleanOrMediaTrackConstraints(bool)

MediaCaptureUnions.cs

Creates the union from the boolean.

public static implicit operator BooleanOrMediaTrackConstraints(bool value)
Parameters
value bool
Returns

BooleanOrMediaTrackConstraints

operator !=(BooleanOrMediaTrackConstraints, BooleanOrMediaTrackConstraints)

MediaCaptureUnions.cs

Returns whether the two unions hold different values.