banner art

src attribute

The src attribute identifies the content source of a media element using a URL, Universal Naming Convention (UNC) path, or absolute path. The source can be any type of digital media content or file as long as there is an enabled data source plug-in that can access the content and a media parser or playlist parser plug-in that can parse the content. In general, any stream that can be assigned as the source of a publishing point is a valid value for the src attribute. By default, you can specify any of the following sources for a media element: a Windows Media file, a JPEG image file, an MP3 audio file, an encoder stream, a stream or file from a remote Windows Media server, a stream or file from a local publishing point, or a playlist file.

The following example uses four types of content sources in one playlist:

<?wsx version='1.0'?>
<smil>
	<media id="VideoFile" src="D:\LocalMedia\Video4.wmv"/>
	<media id="Playlist" src="Playlist.wsx"/>
	<media id="LocalPubPoint" src="lpp://pubpoint5"/>
	<media id="LiveStream" src="http://encoder:1000"/>
</smil>

The following table shows examples of valid path syntax for the src attribute.

Value Description
%systemdrive%\Wmpub\Wmroot\Movie1.wmv

\\Server1\Movie_Folder\Movie1.wmv

References a digital media file on a local or remote server.
%systemdrive%\Wmpub\Wmroot\Playlist1.wsx

\\Server1\Playlist_Folder\Playlist1.wsx

References a playlist file on a local or remote server.
http://encoder1:port References an encoder stream.
rtsp://server2/pubpoint2

http://server2/pubpoint

References a stream from another publishing point on a local or remote Windows Media server.
http://server1/station_name

http://server1/pubpoint

References a stream from a station or publishing point on a server running Windows 2000 Server with Windows Media Services version 4.1, which requires the HTTP protocol.
rtsp://server2/pubpoint1/movie1.wmv References a specific digital media file or playlist from a publishing point on a remote Windows Media server. You can specify whether the stream is sent using UDP or TCP by changing the protocol to RTSPU or RTSPT, respectively.
lpp://pubpoint1/movie1.wmv References a specific digital media file or playlist from another publishing point on the local Windows Media server.
httpd://server1/custom_playlist.asp

httpd://server1/playlist.wsx

References a Web server page that generates a custom playlist file.
MCast://C:\Wmpub\Wmroot\File.nsc

MCast://\\MachineName\Inetpub\Wwwroot\File.nsc

References a multicast stream using the multicast information file. Relative URLs cannot be used to specify this path.

If the publishing point is on a local server, you can use an lpp:// (local publishing point) prefix instead of specifying the server name in the path. Content streamed using the lpp:// prefix is more efficient because it does not use the network transport layer. However, if the specified publishing point has a wrapper playlist enabled, the contents of the wrapper will not be streamed. If you want to include the wrapper content with the publishing point content, you must use the rtsp:// or http:// prefixes instead of lpp://.

The following examples illustrate the use of physical and relative URLs. The media elements illustrate three ways that you can reference Movie1.wmv if the playlist is located at C:\Wmroot\Playlist.wsx:

<media src="c:\wmroot\Movie1.wmv" />

In the previous example, the src attribute uses the physical path of Movie1.wmv.

<media src=".\Movie1.wmv"/>

This example uses a relative URL, substituting the base URL with the path segment of a period (.), which indicates that the content is located on the current directory level. The path segment could also be represented by two periods (..) to indicate that the content is located on the directory level above the current level.

<media src="Movie1.wmv"/>

This example specifies the file name only. If the src attribute value is a file name without a path, the absolute base URL is implied, which means that the playlist and the file are in the same location.

The src attribute can be specified for the following playlist element:

Note Image Notes

Related topics


© 2005 Microsoft Corporation. All rights reserved.