Share via


IWMSPlaylist Interface

You can use the IWMSPlaylist interface to manage a playlist.

In addition to the methods inherited from IXMLDOMDocument, the IWMSPlaylist interface exposes the following methods.

Method

Description

CueStream

Prepares the next stream in the queue.

FireEvent

Sends the specified event to the playlist.

get_CallerEntry

Retrieves the current caller entry.

get_CurrentMediaInformation

Retrieves an IWMSActiveMedia interface containing information about the active media element in the playlist.

get_CurrentPlaylistEntry

Retrieves the active playlist element.

get_ElapsedSimpleTime

Retrieves the simple duration of the active playlist element.

get_IsStreamCued

Retrieves a Boolean value indicating whether a specific playlist element has been initialized and is ready to stream.

get_NestedPlaylist

Retrieves a nested playlist object.

put_CurrentPlaylistEntry

Specifies the active playlist element.

UncueStream

Specifies that content previously prepared for streaming is uncued.

Example

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

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

// Declare variables and interfaces.
IWMSServer      *pServer;
IWMSPlayers     *pPlayers;
IWMSPlayer      *pPlayer;
IWMSPlaylist    *pPlaylist;

HRESULT         hr;
CComVariant     varIndex;
long            lCount;

// 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
// and retrieve the total count of current connections.
hr = pServer->get_Players(&pPlayers);
if (FAILED(hr)) goto EXIT;
hr = pPlayers->get_Count(&lCount);
if (FAILED(hr)) goto EXIT;

// Retrieve information about each requested playlist.
for (long x = 0; x < lCount; x++)
{
    varIndex = x;
    hr = pPlayers->get_Item(varIndex, &pPlayer);
    if (FAILED(hr)) goto EXIT;

    // Retrieve the playlist requested by the client
    // if one exists.
    hr = pPlayer->get_RequestedPlaylist(&pPlaylist);
    if (FAILED(hr)) goto EXIT;

    // Release temporary COM objects.
    pPlayer->Release();
    pPlaylist->Release();
}

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

See Also

Concepts

Server Object Model Interfaces (C++)