StreamInfo Class

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 Windows PhoneAttributesGets or sets attributes for this stream.
Public propertySupported by Windows PhoneAvailableTracksGets the AvailableTracks property.
Public propertySupported by Windows PhoneChildStreamsGets the ChildStreams property.
Public propertySupported by Windows PhoneChunkListGets the list of chunks for this stream.
Public propertySupported by Windows PhoneParentStreamGets or sets the parent stream in the case of a sparse stream. Otherwise this is null.
Public propertySupported by Windows PhoneSegmentGets or sets the segment for this stream.
Public propertySupported by Windows PhoneSelectedTracksGets or sets the SelectedTracks property.
Public propertySupported by Windows PhoneSubtypeGets or sets the Subtype property.
Public propertyTimescaleGets or sets the time scale of the stream.
Public propertySupported by Windows PhoneTypeGets or sets the Type property.
Public propertySupported by Windows PhoneUniqueIdGets or sets the Id that identifies this stream.
Top

  NameDescription
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 PhoneRestrictTracksReplaces AvailableTracks with the specified list of available tracks.
Public methodSupported by Windows PhoneSelectTracksSelects TrackInfo objects for this stream. For more information see Select and Monitor Bitrate.
Public methodSupported by 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 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: 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:
© 2016 Microsoft