Поделиться через


IWMSPlayers Interface

The IWMSPlayers Interface contains a collection of players that are connected to the server. Each player is associated with an IWMSPlayerIWMSPlayer Interface. You can use the IWMSPlayer interface to retrieve properties for a specific player.

In addition to the methods inherited from IDispatch, the IWMSPlayers interface exposes the following methods.

Method

Description

get_Count

Retrieves the number of IWMSPlayer interfaces that are contained in the IWMSPlayers collection.

get_Item

Retrieves a specific IWMSPlayer interface from the IWMSPlayers collection.

get_length

Retrieves the number of IWMSPlayer interfaces that are contained in the IWMSPlayers collection. This method is provided for JScript compatibility.

Refresh

Updates the list of IWMSPlayer interfaces in the IWMSPlayers collection to reflect the connected players.

Remove

Disconnects a specific player from the server and removes it from the IWMSPlayers collection.

RemoveAll

Disconnects all players from the server and removes them from the IWMSPlayers collection.

Example

The following example illustrates how to retrieve a pointer to an IWMSPlayers interface

#include <windows.h>
#include "wmsserver.h"

// Declare variables and interfaces.
IWMSServer      *pServer;
IWMSPlayers     *pPlayers;

HRESULT         hr;

// Initialize the COM library and retrieve a pointer
// to an IWMSServer interface.
hr = CoInitialize(NULL);
hr = CoCreateInstance(CLSID_WMSServer,
                      NULL,
                      CLSCTX_ALL,
                      IID_IWMSServer,
                      (void **)&pServer);
if (FAILED(hr)) goto EXIT;

// Retrieve a pointer to an IWMSPlayers interface.
hr = pServer->get_Players(&pPlayers);
if (FAILED(hr)) goto EXIT;

EXIT:
    // TODO: Release temporary COM objects and uninitialize COM.

See Also

Reference

IWMSPlayer Interface

IWMSPublishingPoint Interface

IWMSServer Interface

Concepts

Server Object Model Interfaces (C++)