Programming Playlists

banner art

Previous Next

Programming Playlists

You can use can use a server-side playlist to identify the audio and video content that a Windows Media server will send to a client and to define the temporal behavior of that content. Typically, a playlist is stored in a file, and the server uses a playlist parser plug-in to read the file and create a playlist object in memory. The syntax of the playlist object must comply with the Synchronized Multimedia Integration Language (SMIL) 2.0 specification. SMIL is an XML-based language designed for use with interactive multimedia presentations. This is the only syntax that the server can understand. If you create a playlist file that uses the SMIL 2.0 subset described in the Windows Media Services SDK, the server can use the WMS SMIL Playlist Parser plug-in to read it. However, if you use a different syntax for your playlist, you must create a custom playlist parser plug-in.

The following playlist is an Extensible Markup Language (XML) document that complies with the SMIL 2.0 specification. The playlist sends two Windows Media files to a client. Both clips run for their full duration, and the second clip starts when the first clip ends. If the WMS SMIL Playlist parser plug-in is enabled, the server will use it to read the playlist file and create a playlist object in memory. For more information about the SMIL 2.0 Specification, W3C Recommendation, see the W3C Web site.

<?wsx version="1.0"?>
<smil>
    <media id="m1" src="c:\wmpub\wmroot\Clip_1.wmv" />
    <media id="m2" src="c:\wmpub\wmroot\Clip_2.wmv" />
</smil>

After a playlist object has been created, you can use the XML Document Object Model (DOM) and the Windows Media Services SDK to create and modify it programmatically. For example, you can insert ads into a playlist, reference media items that will be played only when an event is raised, dynamically substitute media items and more. The following sections discuss playlists in detail.

For information on client-side playlists, see the Windows Media Metafiles section of the Windows Media Player 10 SDK.

See Also

Previous Next