Export (0) Print
Expand All

TrackInfo Class

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

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

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


public class TrackInfo : IComparable

The TrackInfo type exposes the following members.

  NameDescription
Public propertySupported by Windows PhoneAttributesGets or sets the attributes for a track.
Public propertySupported by Windows PhoneBitrateGets or sets the Bitrate property.
Public propertySupported by Windows PhoneCustomAttributesGets or sets the CustomAttributes property.
Public propertySupported by Windows PhoneIndexGets or sets the Index property.
Public propertySupported by Windows PhoneStreamGets the stream for this track.
Top

  NameDescription
Public methodBeginGetChunkBeginning method of the asynchronous API for the application to get chunk content based on the timestamp.
Public methodSupported by Windows PhoneCompareToCompares a T:Microsoft.Web.Media.SmoothStreaming.TrackInfo object to an object specified by the obj parameter.
Public methodEndGetChunkMethod to complete the action of BeginGetChunk.
Public methodSupported by Windows PhoneEquals (Inherited from Object.)
Protected methodSupported by Windows PhoneFinalize (Inherited from Object.)
Public methodSupported by Windows PhoneGetChunkUriGets the Uri for the chunk identified by the timestamp parameter.
Public methodSupported by Windows PhoneGetHashCode (Inherited from Object.)
Public methodSupported by Windows PhoneGetType (Inherited from Object.)
Protected methodSupported by Windows PhoneMemberwiseClone (Inherited from Object.)
Public methodSupported by Windows PhoneToStringWrites a TrackInfo object to string. (Overrides Object.ToString().)
Top

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."

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);
                    }
                }
            }
        }
    }

Silverlight

Supported in: 5

Windows Phone

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

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