Class MediaStreamTrack
Represents a single media track within a stream.
Implements
Inherited Members
Namespace: Unity.WebRTC
Assembly: Unity.WebRTC.dll
Syntax
public class MediaStreamTrack : RefCountedObject, IDisposable
Remarks
MediaStreamTrack
represents a single media track within a stream.
Typically, these are audio or video tracks, but other track types may exist as well.
Each track is associated with a MediaStream
object.
Examples
IEnumerable<MediaStreamTrack> mediaStreamTracks = mediaStream.GetTracks();
Properties
Enabled
Boolean value that indicates whether the track is allowed to render the source stream.
Declaration
public bool Enabled { get; set; }
Property Value
Type | Description |
---|---|
bool |
Remarks
When the value is true
, a track's data is output from the source to the destination; otherwise, empty frames are output.
See Also
Id
String containing a unique identifier (GUID) for the track.
Declaration
public string Id { get; }
Property Value
Type | Description |
---|---|
string |
See Also
Kind
TrackKind value that describes the type of media for the track.
Declaration
public TrackKind Kind { get; }
Property Value
Type | Description |
---|---|
TrackKind |
See Also
ReadyState
TrackState value that describes the status of the track.
Declaration
public TrackState ReadyState { get; }
Property Value
Type | Description |
---|---|
TrackState |
See Also
Methods
Dispose()
Disposes of MediaStreamTrack.
Declaration
public override void Dispose()
Overrides
Remarks
Dispose
method disposes of the MediaStreamTrack
and releases the associated resources.
Examples
mediaStreamTrack.Dispose();
See Also
~MediaStreamTrack()
Finalizer for MediaStreamTrack.
Declaration
protected ~MediaStreamTrack()
Remarks
Ensures that resources are released by calling the Dispose
method
See Also
Stop()
Stops the track.
Declaration
public void Stop()
Remarks
Stop
method disassociates the track from its source (video or audio) without destroying the track.
Examples
mediaStreamTrack.Stop();