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 | |
---|---|---|
Attributes | Gets or sets the attributes for a track. | |
Bitrate | Gets or sets the Bitrate property. | |
CustomAttributes | Gets or sets the CustomAttributes property. | |
Index | Gets or sets the Index property. | |
Stream | Gets the stream for this track. |
Top
Methods
Name | Description | |
---|---|---|
BeginGetChunk | Beginning method of the asynchronous API for the application to get chunk content based on the timestamp. | |
CompareTo | Compares a T:Microsoft.Web.Media.SmoothStreaming.TrackInfo object to an object specified by the obj parameter. | |
EndGetChunk | Method to complete the action of BeginGetChunk. | |
Equals | (Inherited from Object.) | |
Finalize | (Inherited from Object.) | |
GetChunkUri | Gets the Uri for the chunk identified by the timestamp parameter. | |
GetHashCode | (Inherited from Object.) | |
GetType | (Inherited from Object.) | |
MemberwiseClone | (Inherited from Object.) | |
ToString | Writes a TrackInfo object to string. (Overrides Object.ToString().) |
Top
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.