banner art

Constructing a playlist

A playlist file is made up of seven basic Extensible Markup Language (XML) elements: smil, media, seq, switch, excl, priorityClass, and clientData. An element can either contain information about the element or control the behavior of one or more other elements. By arranging these elements and setting values for their corresponding attributes, you can determine the playback and presentation structure of a playlist.

The organization of the playlist elements defines the playlist's control structure. For example, if you open a playlist in a text editor, you will notice that some playlist elements are enclosed within other playlist elements. Elements that contain other playlist elements are known as parent elements. A parent element controls the behavior of all the elements within it, known as the child elements.

Six of the seven basic XML playlist elements act as parent elements: smil, seq, excl, media, priorityClass, and switch. The seq and excl elements act as time containers, meaning that they control the timing of child elements. The priorityClass and switch elements act as control containers, meaning that they control the interaction of child elements.

The following example shows two media elements contained inside a seq element.

<seq>
	<media src="File3.wmv"/>
	<media src="File4.wmv"/>
</seq>

The function of a seq element is to stream the elements that are contained within it in order. Therefore, in the previous example, File3.wmv will play first, followed by File4.wmv. This arrangement of elements contained within other elements is called nesting.

In a playlist, the smil element is the document root, meaning that it is the parent of all the other elements in the playlist. In the following example, a seq element is the child the smil element. The seq element contains media and clientData elements, which are modified by src and title attributes, respectively. The wsx element preceding the smil element is used to identify the version of the server-side Synchronized Multimedia Integration Language (SMIL) syntax being used.

<?wsx version='1.0'?>
<smil>
	<seq>
		<media src="file1.wmv">
			<clientData title="My File #1"/>
		</media>
		<media src="file2.wmv">
			<clientData title="My File #2"/>
		</media>
		<media src="file3.wmv">
			<clientData title="My File #3"/>
		</media>
		<media src="File4.wmv"/>
			<clientData title="My File #4"/>
		</media>
	</seq>
</smil>

Once you understand the playlist elements and their attributes, you will be able to construct many creative solutions for presenting your digital media content.

Related topics


© 2005 Microsoft Corporation. All rights reserved.