Compartir a través de


Downloading a Playlist from a Web Server

You can create and modify playlists using only the server object model. However, you can also use Active Server Pages (ASP) on a Web server to create a playlist dynamically and download it to a Windows Media server. If a client connects to a publishing point and requests a playlist that contains a reference to the ASP page, or if the IWMSPublishingPoint.PathIWMSPublishingPoint.Path (Visual Basic .NET) property references the ASP page, the Windows Media server downloads the playlist created by the page and parses it using a playlist parser plug-in. For example, assume that a client connects to the default on-demand publishing point by using the following URL.

    mms://server_name/playlist.wsx

Note

Windows Media Player 9 Series and later versions can send cookies to a Windows Media server. However, these players support only HTTP and RTSP protocols. Therefore, if you specify MMS, the player rolls over to RTSP or HTTP.

The playlist file, playlist.wsx contains a reference to an ASP page on a Web server.,

    <?wsx version="1.0"?>
    <smil>
        <media src="httpd://web_server/playlist.asp?
              User=%UserName%&amp;
              UserID=%UserID%&amp;
              ClientIP=%UserIP%" />
    </smil>

The media element in the playlist identifies a URL that contains an httpd:// prefix, a reference to an ASP page, and a query string. The ASP page dynamically creates a playlist file in response to information contained in the query string, and the httpd:// prefix indicates that the WMS HTTP Download Data Source plug-in is used to download the playlist from the Web server to the Windows Media server.

Note

If you are downloading a playlist from a Web server that sends an authentication challenge, you must specify a user name and password by using the IWMSPublishingPoint.SetDistributionUserNamePasswordIWMSPublishingPoint.SetDistributionUserNamePassword (Visual Basic .NET).

The query string must start with a question mark and be made up of one or more name/value pairs separated by an ampersand.

Note

XML requires that you use several predefined entity references, such as for ampersand, to denote document symbols that can be mistaken as markup. For more information, see XML Entity References.

The query string can contain any of the string values identified in the following table. When the Windows Media server processes the playlist, it replaces the strings with the appropriate values.

String value

Description

%UserID%

Replaced with the value of the WMS_USER_ID property from the user context.

%UserName%

Replaced with the value of the WMS_USER_NAME property from the user context.

%UserIP%

Replaced with the value of the WMS_USER_IP_ADDRESS_STRING property from the user context.

%UserAgent%

Replaced with the value of the WMS_USER_AGENT property from the user context.

%QueryString%

Replaced with the query string component of the WMS_PRESENT_ORIGINAL_REQUEST_NAME property from the presentation context.

%UserGUID%

Replaced with the value of the WMS_USER_GUID property from the user context.

%PublishingPointPath%

Replaced with the path of the publishing point associated with the playlist.

%UserCookie_CookieName%

Replaced with the name of the cookie indicated by the CookieName portion of the string. The cookie is added to the request header sent to the Web server.

The Windows Media server uses a playlist parser plug-in and the downloaded playlist to create a playlist object in the data path. You can, of course, use the XML DOM to further modify the playlist. The following sections discuss how to create personalized playlists.

Section

Description

The HTTP Download Plug-in

Discusses how the server uses the WMS Download Data Source plug-in to download a playlist and how it chooses a playlist parser plug-in to create a playlist object.

Sending Cookies to the Web Server

Discusses how you can use the Windows Media server to pass cookies from a client to an upstream Web server before downloading a playlist.

ASP Page Examples

Illustrates how to create a custom playlist by using client information from a URL query string.

Using Secure Sockets when Downloading Playlists

Discusses how to use Secure Sockets Layer (SSL) when sending information in the query string of an httpd request.

See Also

Concepts

Programming Playlists