IWMSPlayer.Status (Visual Basic .NET)
Previous | Next |
IWMSPlayer.Status (Visual Basic .NET)
The Status property retrieves the status of the player.
Syntax
WMS_CLIENT_STATUS = IWMSPlayer.Status
Property Value
A member of a WMS_CLIENT_STATUS enumeration type that indicates the status of the player. This must be one of the following values.
Value | Description |
WMS_CLIENT_DISCONNECTED | The player has been disconnected. |
WMS_CLIENT_IDLE | The player is connected to the server but no content is being streamed. |
WMS_CLIENT_OPEN | The player is connected to the server and a resource has been opened to stream. Players that send a pause or stop command will also have this status. |
WMS_CLIENT_STREAMING | The player is connected to the server and that content is being streamed. |
Remarks
This property is read-only. If a client has been disconnected, you can use the IWMSPlayers.Refresh method to update the IWMSPlayers collection.
Example Code
Imports Microsoft.WindowsMediaServices.Interop Imports System.Runtime.InteropServices Private Sub GetPlayerStatus() ' Declare variables. Dim Server As WMSServer Dim Players As IWMSPlayers Dim Player As IWMSPlayer Dim pStatus As WMS_CLIENT_STATUS Try ' Create the WMSServer object. Server = New WMSServer() ' Retrieve the IWMSPlayers object. Players = Server.Players ' Retrieve information about each client connection. For Each Player In Players ' Retrieve the client status. pStatus = Player.Status Select Case pStatus Case WMS_CLIENT_STATUS.WMS_CLIENT_DISCONNECTED ' TODO: Handle disconnected clients. Case WMS_CLIENT_STATUS.WMS_CLIENT_IDLE ' TODO: Handle idle clients. Case WMS_CLIENT_STATUS.WMS_CLIENT_OPEN ' TODO: Handle open clients. Case WMS_CLIENT_STATUS.WMS_CLIENT_STREAMING ' TODO: Handle streaming clients. Case Else ' TODO: Handle default case. End Select Next 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
- IWMSPlayer Object (Visual Basic .NET)
- IWMSPlayers Object (Visual Basic .NET)
- IWMSPlayers.Refresh (Visual Basic .NET)
Previous | Next |