TrackInfo Class

Represents track information that corresponds to the QualityLevel element of the client manifest.

Inheritance Hierarchy

System.Object
Microsoft.Web.Media.SmoothStreaming.TrackInfo

Namespace: Microsoft.Web.Media.SmoothStreaming
Assembly: Microsoft.Web.Media.SmoothStreaming (in Microsoft.Web.Media.SmoothStreaming.dll)

Syntax

'Declaration

Public Class TrackInfo _
    Implements IComparable
'Usage

Dim instance As TrackInfo
public class TrackInfo : IComparable
public ref class TrackInfo : IComparable
type TrackInfo =  
    class
        interface IComparable
    end
public class TrackInfo implements IComparable

The TrackInfo type exposes the following members.

Properties

Name Description
Public propertySupported by Windows Phone Attributes Gets or sets the attributes for a track.
Public propertySupported by Windows Phone Bitrate Gets or sets the Bitrate property.
Public propertySupported by Windows Phone CustomAttributes Gets or sets the CustomAttributes property.
Public propertySupported by Windows Phone Index Gets or sets the Index property.
Public propertySupported by Windows Phone Stream Gets the stream for this track.

Methods

Name Description
Public method BeginGetChunk Beginning method of the asynchronous API for the application to get chunk content based on the timestamp.
Public methodSupported by Windows Phone CompareTo Compares a T:Microsoft.Web.Media.SmoothStreaming.TrackInfo object to an object specified by the obj parameter.
Public method EndGetChunk Method to complete the action of BeginGetChunk.
Public methodSupported by Windows Phone Equals (Inherited from Object.)
Protected methodSupported by Windows Phone Finalize (Inherited from Object.)
Public methodSupported by Windows Phone GetChunkUri Gets the Uri for the chunk identified by the timestamp parameter.
Public methodSupported by Windows Phone GetHashCode (Inherited from Object.)
Public methodSupported by Windows Phone GetType (Inherited from Object.)
Protected methodSupported by Windows Phone MemberwiseClone (Inherited from Object.)
Public methodSupported by Windows Phone ToString Writes a TrackInfo object to string. (Overrides Object.ToString().)

Remarks

The QualityLevel elements of the client manifest are nested inside StreamIndex elements. To access the corresponding TrackInfo objects in application code, start with the AvailableStreams property of the SegmentInfo object. Both the AvailableStreams and SelectedStreams collections contain StreamInfo objects, which, in turn, contain TrackInfo objects in the AvailableTracks and SelectedTracks properties.

For an example that uses TrackInfo objects, see Timeline Markers and Events under the heading "Extract Timeline Events and Assign Markers."

Examples

The following example shows how to parse SegmentInfo and StreamInfo objects to access TrackInfo objects.

    void SmoothPlayer_ManifestReady(object sender, EventArgs e)
    {
        if (!PremiumAccount)
        {
            foreach (SegmentInfo segment in SmoothPlayer.ManifestInfo.Segments)
            {
                IList<StreamInfo> streamInfoList = segment.AvailableStreams;
                foreach (StreamInfo stream in streamInfoList)
                {
                    if (stream.Type == MediaStreamType.Video)
                    {
                        // Limit bit-rate to 866000.
                        ulong highRate = 866000 + 1;
                        List<TrackInfo> tracks = new List<TrackInfo>();

                        tracks = stream.AvailableTracks.ToList<TrackInfo>();
                        IList<TrackInfo> allowedTracks = tracks.Where((ti) => ti.Bitrate < highRate).ToList();
                        stream.SelectTracks(allowedTracks, false);
                    }
                }
            }
        }
    }

Version Information

Silverlight

Supported in: 5

Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.Web.Media.SmoothStreaming Namespace