Export (0) Print
Expand All

StreamInfo Class

Defines the basic information for each stream. This class corresponds to the StreamIndex element of the client manifest. You can extend the class to add private data per stream.

System..::..Object
  Microsoft.Web.Media.SmoothStreaming..::..StreamInfo

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

public class StreamInfo

The StreamInfo type exposes the following members.

  NameDescription
Public propertySupported by Silverlight for Windows PhoneAttributesGets or sets attributes for this stream.
Public propertySupported by Silverlight for Windows PhoneAvailableTracksGets the AvailableTracks property.
Public propertySupported by Silverlight for Windows PhoneChildStreamsGets the ChildStreams property.
Public propertySupported by Silverlight for Windows PhoneChunkListGets the list of chunks for this stream.
Public propertySupported by Silverlight for Windows PhoneParentStreamGets or sets the parent stream in the case of a sparse stream. Otherwise this is null.
Public propertySupported by Silverlight for Windows PhoneSegmentGets or sets the segment for this stream.
Public propertySupported by Silverlight for Windows PhoneSelectedTracksGets or sets the SelectedTracks property.
Public propertySupported by Silverlight for Windows PhoneSubtypeGets or sets the Subtype property.
Public propertySupported by Silverlight for Windows PhoneTypeGets or sets the Type property.
Public propertySupported by Silverlight for Windows PhoneUniqueIdGets or sets the Id that identifies this stream.
Top

  NameDescription
Public methodSupported by Silverlight for Windows PhoneEquals (Inherited from Object.)
Protected methodSupported by Silverlight for Windows PhoneFinalize (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneGetHashCode (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneGetType (Inherited from Object.)
Protected methodSupported by Silverlight for Windows PhoneMemberwiseClone (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneRestrictTracksReplaces AvailableTracks with the list of available tracks supplied by the parameter. Also restricts decoder initialization to the given list of available tracks to avoid initializing the decoder with unsupported modes.
Public methodSupported by Silverlight for Windows PhoneSelectTracksSelects TrackInfo objects for this stream. For more information see Select and Monitor Bit Rate (IIS Smooth Streaming).
Public methodSupported by Silverlight for Windows PhoneToStringWrites the StreamInfo item to a string. (Overrides Object..::..ToString()()()().)
Top

The AvailableStreams property of the SegmentInfo object contains a collection of StreamInfo objects. The SelectedStreams property of the SegmentInfo object must include exactly one video StreamInfo object and one audio StreamInfo object. Text streams do not have this restriction and can be multiply selected and deselected. Streams must be members of the current segment’s AvailableStreams and/or SelectedStreams property. To generate the lists of available streams or selected streams use a List<T>.CopyTo constructor of type StreamInfo to copy either the AvailableStreams or the SelectedStreams property. Add or remove streams until you have the desired list.

Notifications for de-selection of current streams will arrive before selection notifications on a per-segment basis. Applications can clean up any state associated with the deselected stream before adding state associated with the new stream. However, due to the possibility of multiple segments, it is preferable to use the UniqueId property to identify the stream with which objects are associated.

For an implementation example that parses StreamInfo objects, see Timeline Markers and Events (IIS Smooth Streaming) under the heading "Extract Timeline Events and Assign Markers."

The following example shows how to get SegmentInfo and StreamInfo objects from the ManifestInfo object.

    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: 4

Silverlight for Windows Phone

Supported in: 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