IWMSActiveStreams Interface

The IWMSActiveStreams interface contains a collection of IWMSActiveStream interfaces that provide information about specific audio and video streams in the active media element. The IWMSActiveMediaIWMSActiveMedia Interface provides information about the active element.

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




Retrieves the number of IWMSActiveStream interfaces in the IWMSActiveStreams collection.


Retrieves a specific IWMSActiveStream interface, by index, from the IWMSActiveStreams collection.


Retrieves the number of IWMSActiveStream interfaces in the IWMSActiveStreams collection. This method is provided for JScript compatibility.


The following example illustrates how to retrieve a pointer to an IWMSActiveStreams interface.

#include <windows.h>
#include <atlbase.h>    // Includes CComVariant.
#include "wmsserver.h"

// Declare variables and interfaces.
HRESULT             hr;
IWMSServer          *pServer;
IWMSPlayers         *pPlayers;
IWMSPlayer          *pPlayer;
IWMSPlaylist        *pPlaylist;
IWMSActiveMedia     *pActiveMedia;
IWMSActiveStreams   *pActiveStreams;

CComVariant         varIndex;
long                lCount;

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

// Retrieve a pointer to the IWMSPlayers interface
// and retrieve the number of connected players.
hr = pServer->get_Players(&pPlayers);
if (FAILED(hr)) goto EXIT;
hr = pPlayers->get_Count(&lCount);
if (FAILED(hr)) goto EXIT;

// If players are connected, retrieve a pointer to
// an IWMSPlayer interface containing the first player.
if (lCount > 0)
    varIndex = 0;
    hr = pPlayers->get_Item(varIndex, &pPlayer);
    if (FAILED(hr)) goto EXIT;
// Retrieve the playlist 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.
hr = pPlayer->get_RequestedPlaylist(&pPlaylist);
if (FAILED(hr)) goto EXIT;
if (pPlaylist != NULL)
    // Retrieve a pointer to the IWMSActiveMedia interface.
    hr = pPlaylist->get_CurrentMediaInformation(&pActiveMedia);
    if (FAILED(hr)) goto EXIT;

    // Retrieve a pointer to the IWMSActiveStreams interface.
    hr = pActiveMedia->get_Streams(&pActiveStreams);
    if (FAILED(hr)) goto EXIT;

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

See Also


IWMSActiveMedia Interface

IWMSActiveStream Interface


Server Object Model Interfaces (C++)