Partager via


The Playlist Object

When a client connects to a publishing point that points to a playlist, the server uses plug-ins to read content from a source and send it to the client along an artificial construct called a data path. Plug-ins create objects in the data path to perform the reading, buffering, and writing operations. For example, consider the following playlist.

<?wsx version="1.0"?>
<smil>
    <media id="media1" src="c:\wmpub\wmroot\ad1.wmv" />
    <media id="media2" src="c:\wmpub\wmroot\movie.wmv" />
</smil>

The playlist first sends a Windows Media file containing an advertisement, before sending a movie to the client. The following diagram illustrates some of the data path objects used by the server to process both the playlist and the media items pointed to by the playlist.

Diagram illustrating the playlist object in a data path.

Dd873659.wms8_plylstobjindatapath_final(en-us,VS.85).gif

To create the data path for the playlist, a Windows Media server performs the following actions:

  1. The server uses a file data source plug-in to create a data container object and read the playlist file into a buffer. The data container object implements the IWMSDataContainer interface.

  2. The server uses an SMIL playlist parser plug-in to create a playlist parser object that reads the buffer filled in step 1, and creates an in-memory tree structure called a playlist object. The playlist object implements the IWMSPlaylist interface, and you can manipulate it by using the XML Document Object Model (DOM). The playlist parser plug-in implements the IWMSPlaylistParserPlugin interface and the IWMSPlaylistParser interface.

  3. The server uses the playlist object created in step 2 to determine the order in which media items must be streamed to the client. Because the first item in the playlist above is a Windows Media file, ad1.wmv, the server again uses a file data source plug-in to read data from the file into a buffer. It then uses an appropriate media parser plug-in to create a media parser object that makes a packet list of offsets into the buffer and sends the packets to a network data sink.

  4. Before the server finishes streaming data from the Windows Media file, it queues data from movie.wmv. To read the movie, the server again uses a file data source plug-in. To packetize the data in the buffer, the server uses a media parser object created by a media parser plug-in.

Windows Media Services contains both a directory playlist parser plug-in and an SMIL playlist parser plug-in. To use a playlist that is not based on SMIL or is not made up of the items in a directory, you must create a custom playlist parser plug-in. For more information, see Creating Playlist Parser Plug-ins. Playlist parser plug-ins are instantiated when:

  • You enable a playlist parser plug-in by using the Enabled property on the IWMSPlugin interface.

  • You activate a custom interface on a playlist parser plug-in by using the CustomInterface property on the IWMSPlugin interface.

  • The Enabled property on the IWMSPlugin interface is True, and Windows Media Services is started.

The server requests that a playlist parser plug-in create a playlist parser object when:

  • A client requests a playlist from an on-demand publishing point.

  • A broadcast publishing point that points to a playlist file or directory is started.

  • The server reaches a playlist item that points to another playlist.

  • The Save or Load method on the IWMSPlaylist interface or the IXMLDOMDocument interface is called.

If a playlist contains a reference to another playlist, more than one playlist object is created. For example, consider the following playlist, Playlist1.wsx.

<?wsx version="1.0"?>
<smil>
    <media id="media1" src="c:\wmpub\wmroot\ad1.wmv" />
    <media id="media2" src="c:\wmpub\wmroot\Playlist2.wsx" />
</smil>

Playlist2.wsx is defined as follows.

<?wsx version="1.0"?>
<smil>
    <media id="media1" src="http://encoder:7070" />
</smil>

The following diagram identifies the objects created in the data path. The server creates playlist parser and playlist objects for each playlist referenced.

Diagram illustrating multiple playlist objects in a data path.

Dd873659.wms8_plylstobjindatapath_2_final(en-us,VS.85).gif

See Also (General)

See Also (Visual Basic .NET)

See Also (C#)

See Also (C++)