Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
ChunkInfo Class

ChunkInfo Class

Defines per-chunk information for text/binary chunks of Smooth Streaming data.

System.Object
  Microsoft.Web.Media.SmoothStreaming.ChunkInfo

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


public class ChunkInfo : IComparable

The ChunkInfo type exposes the following members.

  NameDescription
Public propertySupported by Windows PhoneAttributesGets or sets Attributes.
Public propertySupported by Windows PhoneDurationTime duration that corresponds the to the <d> element in the manifest for the chunk.
Public propertySupported by Windows PhoneStreamGets the StreamInfo object.
Public propertySupported by Windows PhoneTimeStampGets or sets the start time for the data chunk.
Top

  NameDescription
Public methodSupported by Windows PhoneCompareToCompares a chunk to another object.
Public methodSupported by Windows PhoneEquals (Inherited from Object.)
Protected methodSupported by Windows PhoneFinalize (Inherited from Object.)
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 PhoneToString (Inherited from Object.)
Top

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

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:
© 2015 Microsoft