IWMSActiveStream Object (Visual Basic .NET)

The IWMSActiveStream object contains information about specific audio and video streams in the active media element. The IWMSActiveMedia object provides information about the active element.

The IWMSActiveStream object exposes the following properties.




Retrieves the maximum bit rate of a stream.


Retrieves the stream name.


Retrieves an enumeration value that indicates whether the stream is audio or video.


The following example illustrates how to retrieve an IWMSActiveStream object.

Imports Microsoft.WindowsMediaServices.Interop
Imports System.Runtime.InteropServices

Private Sub RetrieveObj()

    ' Declare variables.
    Dim Server As WMSServer
    Dim Players As IWMSPlayers
    Dim Player As IWMSPlayer
    Dim Playlist As IWMSPlaylist
    Dim ActiveMedia As IWMSActiveMedia
    Dim ActiveStreams As IWMSActiveStreams
    Dim ActiveStream As IWMSActiveStream
    Dim i As Integer

    ' Create the WMSServer object.
    Server = New WMSServer()

    ' Retrieve the IWMSPlayers object.
    Players = Server.Players

    ' If players are connected, retrieve first IWMSPlayer object
    ' in the IWMSPlayers collection.
    If Server.Players.Count > 0 Then
        Player = Server.Players.Item(0)
    End If

    ' Retrieve the IWMSPlaylist object for the player.
    ' NOTE: A valid playlist file is not always returned.
    ' This may be the case, for example, if the user requested
    ' a specific content file or if a broadcast
    ' publishing point is being used.
    Playlist = Player.RequestedPlaylist
    If Not Playlist Is Nothing Then

        ' Retrieve the IWMSActiveMedia object.
        ActiveMedia = Playlist.CurrentMediaInformation

        ' Retrieve the IWMSActiveStreams object.
        ActiveStreams = ActiveMedia.Streams

        ' Retrieve information about each active stream.
        For i = 0 To ActiveStreams.Count - 1

            ' Retrieve the IWMSActiveStream object.
            ActiveStream = ActiveStreams.Item(i)
        Next i
    End If

Catch excCom As COMException
    ' TODO: Handle COM exceptions.
Catch exc As Exception
    ' TODO: Handle errors.
    ' TODO: Clean-up code goes here.
End Try

End Sub

See Also


IWMSActiveMedia Object (Visual Basic .NET)

IWMSActiveStreams Object (Visual Basic .NET)


Server Object Model (Visual Basic .NET)