Share via


WMS Playlist Transform Plug-in Properties

The WMS Playlist Transform plug-in alters the behavior of playlist files by shuffling the content order or causing the playlist to repeat itself continuously. For administration information about this plug-in, see Windows Media Services Help.

You can use the IWMSPlaylistTransformAdmin interface to configure the following properties.

Property

Description

InfiniteRepeat

Specifies and retrieves a Boolean value indicating whether a playlist will automatically loop back to the beginning after all files have been played.

Shuffle

Specifies and retrieves a Boolean value indicating whether content in a playlist is played in a random order.

The following examples demonstrate how to use the IWMSPlaylistTransformAdmin interface to configure the properties of the WMS Playlist Transform plug-in.

Visual Basic .NET Example

Imports Microsoft.WindowsMediaServices.Interop 
Imports System.Runtime.InteropServices

Private Sub SetPlylstTrnsfrmPluginProps() 

' Declare variables.
Dim Server As WMSServer
Dim Plugin As IWMSPlugin
Dim PlylstTrnsfrmAdmin As IWMSPlaylistTransformAdmin

Try
    ' Create a new WMSServer object.
    Server = New WMSServer()

    ' Retrieve the IWMSPlugin object for the 
    ' WMS Playlist Transform plug-in.
    Plugin = Server.EventHandlers("WMS Playlist Transform")

    ' Retrieve the administrative interface for the plug-in.
    PlylstTrnsfrmAdmin = Plugin.CustomInterface()

    ' Specify a Boolean value indicating whether playlists
    ' on this publishing point automatically repeat
    ' after all files have been played.
    PlylstTrnsfrmAdmin.InfiniteRepeat = True

    ' Specify a Boolean value indicating whether content in
    ' playlist files on this publishing point plays randomly.
    PlylstTrnsfrmAdmin.Shuffle = False

Catch excCom As COMException
    ' TODO: Handle COM exceptions.
Catch exc As Exception
    ' TODO: Handle exceptions here.
Finally
    ' TODO: Perform clean-up here.
End Try

End Sub 

C# Example

using Microsoft.WindowsMediaServices.Interop;
using System.Runtime.InteropServices;

// Declare variables.
WMSServer Server;
IWMSPlugin Plugin;
IWMSPlaylistTransformAdmin PlylstTrnsfrmAdmin;

try
{
    // Create a new WMSServer object.
    Server = new WMSServerClass();
    
    // Retrieve the IWMSPlugin object for the
    // WMS Playlist Transform plug-in.
    Plugin = Server.EventHandlers["WMS Playlist Transform"];
    
    // Retrieve the administrative interface for the plug-in.
    PlylstTrnsfrmAdmin = (IWMSPlaylistTransformAdmin)Plugin.CustomInterface;
    
    // Specify a Boolean value indicating whether playlists
    // on this publishing point automatically repeat
    // after all files have been played.
    PlylstTrnsfrmAdmin.InfiniteRepeat = true;
    
    // Specify a Boolean value indicating whether content in
    // playlist files on this publishing point plays randomly.
    PlylstTrnsfrmAdmin.Shuffle = false;
}
catch (COMException comExc) {
    // TODO: Handle COM exceptions.
}
catch (Exception exc)
{
    // TODO: Handle exceptions here.
}
finally
{
    // TODO: Perform clean-up here.
}

C++ Example

#include <windows.h>
#include <atlbase.h>

// To access system plug-in interfaces, the
// type library must be imported as shown.
#import "WMSServerTypeLib.dll" no_namespace named_guids \
                               raw_interfaces_only

// Declare variables and interface pointers.
IWMSServer*                 pServer = NULL;
IWMSPlugins*                pPlugins = NULL;
IWMSPlugin*                 pPlugin = NULL;
IDispatch*                  pDispatch = NULL;
IWMSPlaylistTransformAdmin* pPlaylistTransformAdmin = NULL;
CComVariant                 varIndex;
HRESULT                     hr = S_OK;

// 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 IWMSPlugins interface
// containing the collection of event handler plug-ins.
hr = pServer->get_EventHandlers(&pPlugins);
if (FAILED(hr)) goto EXIT;

// Retrieve a pointer to the IWMSPlugin interface for the
// WMS Playlist Transform plug-in.
varIndex = "WMS Playlist Transform";
hr = pPlugins->get_Item(varIndex, &pPlugin);
if (FAILED(hr)) goto EXIT;

// Retrieve an IDispatch pointer to the
// administration interface for the plug-in.
hr = pPlugin->get_CustomInterface(&pDispatch);
if (FAILED(hr)) goto EXIT;

// Call QueryInterface() to retrieve a pointer to the
// IWMSPlaylistTransformAdmin interface.
hr = pDispatch->QueryInterface(IID_IWMSPlaylistTransformAdmin, 
                               (void**)&pPlaylistTransformAdmin);
if (FAILED(hr)) goto EXIT;

// Specify a Boolean value indicating whether playlists
// on this publishing point automatically repeat
// after all files have been played.
hr = pPlaylistTransformAdmin->put_InfiniteRepeat(VARIANT_TRUE);
if (FAILED(hr)) goto EXIT;

// Specify a Boolean value indicating whether content in
// playlist files on this publishing point plays randomly.
hr = pPlaylistTransformAdmin->put_Shuffle(VARIANT_FALSE);
if (FAILED(hr)) goto EXIT;

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

See Also

Reference

IWMSPlaylistTransformAdmin Interface

IWMSPlaylistTransformAdmin Object (C#)

IWMSPlaylistTransformAdmin Object (Visual Basic .NET)

Concepts

Programming System Plug-in Properties