ChunkInfo Class
Defines per-chunk information for text/binary chunks of Smooth Streaming data.
Inheritance Hierarchy
System.Object
Microsoft.Web.Media.SmoothStreaming.ChunkInfo
Namespace: Microsoft.Web.Media.SmoothStreaming
Assembly: Microsoft.Web.Media.SmoothStreaming (in Microsoft.Web.Media.SmoothStreaming.dll)
Syntax
'Declaration
Public Class ChunkInfo _
Implements IComparable
'Usage
Dim instance As ChunkInfo
public class ChunkInfo : IComparable
public ref class ChunkInfo : IComparable
type ChunkInfo =
class
interface IComparable
end
public class ChunkInfo implements IComparable
The ChunkInfo type exposes the following members.
Properties
Name | Description | |
---|---|---|
Attributes | Gets or sets Attributes. | |
Duration | Time duration that corresponds the to the <d> element in the manifest for the chunk. | |
Stream | Gets the StreamInfo object. | |
TimeStamp | Gets or sets the start time for the data chunk. |
Top
Methods
Name | Description | |
---|---|---|
CompareTo | Compares a chunk to another object. | |
Equals | (Inherited from Object.) | |
Finalize | (Inherited from Object.) | |
GetHashCode | (Inherited from Object.) | |
GetType | (Inherited from Object.) | |
MemberwiseClone | (Inherited from Object.) | |
ToString | (Inherited from Object.) |
Top
Examples
The following example shows how to get the ChunkInfo objects in a StreamInfo object and how to call the asynchronous method BeginGetChunk(TimeSpan, AsyncCallback, Object). For more information, see Timeline Markers and Events.
foreach (TrackInfo trackInfo in streamInfo.SelectedTracks)
{
foreach (ChunkInfo chunk in streamInfo.ChunkList.ToList<ChunkInfo>())
{
IAsyncResult ar =
trackInfo.BeginGetChunk(
chunk.TimeStamp, new AsyncCallback(AddMarkers), streamInfo.UniqueId);
}
}
The following example shows the call to the EndGetChunk(IAsyncResult) method. For more information on this asynchronous scenario, see Timeline Markers and Events.
foreach (TrackInfo trackInfo in streamInfo.SelectedTracks)
{
ChunkResult chunkResult = trackInfo.EndGetChunk(argAR);
if (chunkResult.Result == ChunkResult.ChunkResultState.Succeeded)
{
System.Text.Encoding enc = System.Text.Encoding.UTF8;
int length = (int)chunkResult.ChunkData.Length;
byte[] rawData = new byte[length];
chunkResult.ChunkData.Read(rawData, 0, length);
String text = enc.GetString(rawData, 0, rawData.Length);
TimelineMarker newMarker = new TimelineMarker();
newMarker.Text = text;
newMarker.Time = chunkResult.Timestamp;
SmoothPlayer.Markers.Add(newMarker);
}
}
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.