The media elements in a playlist provide the locations of digital media sources and can specify how the digital media content plays back or is presented to the client. A media element can refer to any digital media source that can be accessed by a data source plug-in and parsed by a media or playlist parser plug-in. The appropriate plug-ins are enabled by default.
Examples of digital media sources include files on a local computer, streams from a remote computer running Windows Media Encoder or Windows Media Services, other playlist files, Active Server Pages (ASP pages) on Web servers, or digital media files on third-party storage systems.
The following example shows a simple playlist that consists of three digital media types: an image file, a video file, and an audio file:
<?wsx version='1.0'?> <smil> <media src="Title.jpg" dur="10s"/> <media src="Video.wmv"/> <media src="Audio.wma"/> </smil>
The three files play in sequence, starting with the first listed media element. The first media element has a specified value for the dur attribute because image files do not have an implicit duration.
Attributes modify the properties of a playlist element. You can use the following attributes with a media element. The src attribute is the only required attribute.
|src||Specifies the name and location of the source of the digital media content. For more information, see src attribute.|
|begin||Specifies when the media element becomes active. For more information, see begin attribute.|
|clipBegin||Specifies the point in the digital media source at which playback begins. For more information, see clipBegin attribute.|
|clipEnd||Specifies the point in the digital media source at which playback ends. For more information, see clipEnd attribute.|
|dur||Specifies the length of time that the digital media source plays. For more information, see dur attribute.|
|end||Specifies when the media element becomes inactive. For more information, see end attribute.|
|syncEvent||Specifies a string used to trigger the beginning or end of an element in a wrapper playlist. For more information, see syncEvent attribute.|
|id||Specifies a name for the media element that can be referenced by other elements. For more information, see id attribute.|
|mediaName||Specifies a name for the media element to replace the src attribute value in the client log and the client content description list. For more information, see mediaName attribute.|
|noSkip||Specifies whether fast-forward, rewind, seek, or skip are enabled for the media element. For more information, see noSkip attribute.|
|repeatCount||Specifies the number of times the media element repeats before stopping. If no value is specified, the element is played once. For more information, see repeatCount attribute.|
|repeatDur||Specifies the length of time the media element repeats before stopping. For more information, see repeatDur attribute.|
|role||Specifies the role of the media element. For more information, see role attribute.|
The following example playlist shows media elements with id, src, and dur attribute values:
<?wsx version="1.0"?> <smil> <media id="Media1" src="C:\Wmpub\Wmroot\Clip1.wmv" dur="120s" /> <media id="Media2" src="C:\Wmpub\Wmroot\Clip2.wmv" /> </smil>
In this example, Clip1.wmv plays for a duration of two minutes, followed by Clip2.wmv.