IWMSPlaylist.get_NestedPlaylist (C#)

banner art

Previous Next

IWMSPlaylist.get_NestedPlaylist (C#)

The NestedPlaylist property retrieves a nested playlist object.

Syntax

  IWMSPlaylist =
  
  Playlist
  .get_NestedPlaylist(
  
  IXMLDOMElement
    pPlaylistEntry
  
  );

Parameters

pPlaylistEntry

[in] IXMLDOMElement containing a playlist entry object.

Property Value

An IWMSPlaylist object.

Remarks

This property is read-only. This property gets a nested playlist. If the first parameter of the playlist is not a media element that references a playlist file, or if the media element is not cued or is not the current element, an error code is returned.

The IWMSPlaylist.get_IsStreamCued property can be used to determine whether the media element is cued.

If this property fails, it throws an exception.

Number Meaning
0x80004005 Indicates that pPlaylistEntry is not a nested playlist.

Example Playlist File

In the following playlist, the src attribute for "media2" references another playlist.

  

The nested playlist (playlist.wsx) contains the following syntax.

  

A short time after the server starts streaming "media1" from the first playlist, it will cue "nested_media1" in the nested playlist. At this point, the get_NestedPlaylist property can be used to retrieve an IWMSPlaylist object for the nested playlist. After the server finishes streaming all of the items in the nested playlist, it will return to the parent playlist and start streaming "media3". At this point, "media2" will no longer be cued, and you can no longer use the get_NestedPlaylist property to retrieve an IWMSPlaylist object for it. However, you can always use the IWMSPlaylist.CueStream method to re-cue the nested playlist.

Example Code

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

// Declare variables.
WMSServer          Server;
IWMSPlayers        Players;
IWMSPlayer         Player;
IWMSPlaylist       Playlist;
IWMSPlaylist       NestedPlaylist;
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;

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

        // Retrieve information about each playlist entry.
        while (PlaylistEntry != null)
        {
            CurPlaylistEntry = PlaylistEntry;

            // Retrieve the nested playlist object if one exists.
            NestedPlaylist = Playlist.get_NestedPlaylist(PlaylistEntry);

            // Retrieve the next playlist entry.
            PlaylistEntry = Playlist.get_CallerEntry(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