ChunkResult.ChunkResultState Enumeration

An enumeration that contains the possible result states during processing by the BeginGetChunk and EndGetChunk methods.

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

Syntax

'Declaration

Public Enumeration ChunkResultState
'Usage

Dim instance As ChunkResult.ChunkResultState
public enum ChunkResultState
public enum class ChunkResultState
type ChunkResultState
public enum ChunkResultState

Members

Member name Description
Succeeded BeginGetChunk succeeded.
Failed BeginGetChunk failed.
TimedOut BeginGetChunk timed out.

Examples

The following example shows the call to the EndGetChunk(IAsyncResult) method and return of a ChunkResult object that contains the ChunkResult.ChunkResultState that indicates success or failure. 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

See Also

Reference

Microsoft.Web.Media.SmoothStreaming Namespace