Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
.gif)
| Previous | Next |
IWMSActiveStreams.length (Visual Basic .NET)
The length property retrieves the number of IWMSActiveStream objects in the IWMSActiveStreams collection.
Syntax
Integer = IWMSActiveStreams.length
Property Value
Integer containing the number of IWMSActiveStream objects.
Remarks
This property is read-only. This is the JScript version of the IWMSActiveStreams.Count property. It is included for developers more comfortable with JScript syntax.
Example Code
Imports Microsoft.WindowsMediaServices.Interop
Imports System.Runtime.InteropServices
Private Sub GetCount()
' 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 iCount As Integer
Try
' 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 the total number of active streams.
iCount = ActiveStreams.length
End If
Catch excCom As COMException
' TODO: Handle COM exceptions.
Catch exc As Exception
' TODO: Handle errors.
Finally
' TODO: Clean-up code goes here.
End Try
End Sub
Requirements
Reference: Add a reference to Microsoft.WindowsMediaServices.
Namespace: Microsoft.WindowsMediaServices.Interop.
Assembly: Microsoft.WindowsMediaServices.dll.
Library: WMSServerTypeLib.dll.
Platform: Windows Server 2003 family, Windows Server 2008 family.
See Also
| Previous | Next |