A .wsx file is an XML file that defines what you want your playlist to contain and how it should behave. The following .wsx file example specifies three media files to be played, one after the other.
<?wsx version="1.0"?>
<smil>
<seq id="sq1">
<media id="video1" src="clip1.wmv" />
<media id="video2" src="clip2.wmv" />
<media id="video3" src="clip3.wmv" />
<seq>
</smil>
A variety of elements and attributes are supported by .wsx files to provide greater control over media playback than simply playing one video after the other. For example, you can use the clipBegin and clipEnd attributes to serve up a portion of a video. The following example shows how to specify a 15-second portion of a video file to be played.
...
<media id="video1" src="clip1.wmv" clipBegin="15s" clipEnd="30s" />
...
Silverlight supports a subset of the playlist elements and attributes defined by Windows Media. The following table shows the playlist elements and attributes supported by Silverlight. For more information, see the Windows Media 9 Series Playlist Reference in the MSDN Library.
Element & description | Supported attributes |
|---|
smil - The root of the playlist. |
id, repeatDur, dur, repeatCount |
switch - Wraps a series of items and allows the server to switch between them if access to one of the items fails. |
id
|
media - Defines an audio or video file in the playlist. |
dur, id, repeatCount, repeatDur, role, src (only streaming video or audio) |
excl - A time container in which only one media element can be played at a time, but the order in which the elements are played is not restricted. |
dur, id, repeatCount, repeatDur |
seq - A time container that forces media elements within it to play in the order in which they appear within the seq element. |
dur, id, repeatCount, repeatDur |
After you have created a playlist file, you may have to configure the server to work with playlists by adding the MIME type for .wsx files.