Description: Goal- Create a simple ASX file to play Windows Media in the external Windows Media Player. A simple, yet effective method of playing Windows Media, is to simply reference an ASF Stream Redirector file (ASX). An ASX file is an eXtensible Markup Language (XML) based text file which references a Uniform Resource Locator (URL) for a piece of media content. Simply put, an ASX file is a shortcut to Media Content. The following are the hexadecimal number for the specified permissions. The access mask (sum of hex numbers for permissions used), is used in the security descriptor.
An ASX file should always be used to reference media content for the standalone player for two main reasons:
Browsers other than Microsoft Internet Explorer do not intrinsically understand the Microsoft Media Server (MMS) streaming protocol. As such, they cannot locate or obtain information about the Media File. Without an ASX file, content cannot stream to the media player. When you click on a link in a browser, that file is downloaded to the browser's cache. When, however, you click on a reference to an ASX, the ASX (which is a very small download) gets downloaded into the cache, and then launches the helper application associated with the ASX MIME type (application/mplayer2 or video/x-ms-asf), which is the Windows Media Player. This, of course, saves download time and takes advantage of intelligent media serving technology.
Code to Include
To reference an ASX file, simply add the following code to your Web page:
Link to Streaming Content
The browser will open this file and then launch the Windows Media Player to play this content.
Here is the Basic syntax for an ASX file:
Here's what each line does: Line Description
Simple comment, in the same format as HTML comments. Actual pointer to the media content. The REF attribute identifies the line as a pointer to content, while the HREF attribute is the URL to the file. In this case, the URL uses the MMS protocol, so it points to a NetShow Services media server.
Remember that ASF files on your media server are not usually kept in the same location as your HTML documents.
Note: the use of the XML-like closing of the tag. Since this element does not have child elements (data within the tag which is not contained in an attribute), it closes itself.
Since ASXs work through a helper application, they are compatible with any browser that supports helper applications. This sample will work with Internet Explorer 4.0 and greater, and Netscape Navigator 4.0 and greater on the Win32 and Mac platforms.