docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class MediaStreamTrack

    Represents a single media track within a stream.

    Inheritance
    object
    RefCountedObject
    MediaStreamTrack
    AudioStreamTrack
    VideoStreamTrack
    Implements
    IDisposable
    Inherited Members
    RefCountedObject.disposed
    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
    MediaStream

    Id

    String containing a unique identifier (GUID) for the track.

    Declaration
    public string Id { get; }
    Property Value
    Type Description
    string
    See Also
    MediaStream

    Kind

    TrackKind value that describes the type of media for the track.

    Declaration
    public TrackKind Kind { get; }
    Property Value
    Type Description
    TrackKind
    See Also
    MediaStream

    ReadyState

    TrackState value that describes the status of the track.

    Declaration
    public TrackState ReadyState { get; }
    Property Value
    Type Description
    TrackState
    See Also
    MediaStream

    Methods

    Dispose()

    Disposes of MediaStreamTrack.

    Declaration
    public override void Dispose()
    Overrides
    RefCountedObject.Dispose()
    Remarks

    Dispose method disposes of the MediaStreamTrack and releases the associated resources.

    Examples
    mediaStreamTrack.Dispose();
    See Also
    MediaStream

    ~MediaStreamTrack()

    Finalizer for MediaStreamTrack.

    Declaration
    protected ~MediaStreamTrack()
    Remarks

    Ensures that resources are released by calling the Dispose method

    See Also
    MediaStream

    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();
    See Also
    MediaStream

    Implements

    IDisposable

    See Also

    MediaStream
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)