Share via


IWMSPlaylist.CurrentPlaylistEntry (C#)

banner art

Previous Next

IWMSPlaylist.CurrentPlaylistEntry (C#)

The CurrentPlaylistEntry property specifies and retrieves the active playlist element.

Syntax

  Playlist
  .CurrentPlaylistEntry
  
  =
  
  IXMLDOMElement
  ;

  IXMLDOMElement
  
  =
  
  Playlist
  .CurrentPlaylistEntry;

Property Value

An IXMLDOMElement object.

Remarks

There are no restrictions on what element the server's position can be changed to. When CurrentPlaylistEntry is used to make an element that is not currently on the call stack the current element, all items above its parent element are removed from the call stack.

Unlike the FireEvent method, when this property is used to change the server's current position in the playlist, there are no restrictions on what element the server's current position can be changed to.

When this property is used to set the position of the server in the playlist, and the element is currently on the call stack, the server removes all elements above the element on the call stack. If the element is not currently on the call stack, the server removes all elements above its parent element.

  • Note   The CallerEntry property can be used to discover which items are on the playlist call stack.

Example Code

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

// Declare variables.
WMSServer          Server;
IWMSPlayers        Players;
IWMSPlayer         Player;
IWMSPlaylist       Playlist;
IXMLDOMElement     PlaylistEntry;
IXMLDOMElement     CurPlaylistEntry;

try {
    // Create a new WMSServer object.
    Server = new WMSServerClass();

    // Retrieve the IWMSPlayers object.
    Players = Server.Players;

    // Retrieve information about each requested playlist.
    for (int i = 0; i < Players.Count; i++)
    {
        Player = Players[i];

        // Retrieve the playlist that was requested
        // by the client, if one exists.
        Playlist = Player.RequestedPlaylist;

        // Retrieve information about the current playlist entry.
        PlaylistEntry = Playlist.CurrentPlaylistEntry;

        CurPlaylistEntry = PlaylistEntry;

        // Retrieve the next playlist entry.
        PlaylistEntry = Playlist.get_CallerEntry(CurPlaylistEntry);

        //  Set the current playlist entry to the last entry in 
        // the playlist.
        Playlist.CurrentPlaylistEntry = CurPlaylistEntry;
    }







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

Previous Next