ASX Files are simply text files that acts as a link from a Web page to an ASF on NetShow Server or an HTTP server. It transfers control of the data from the HTTP browser to the NetShow Player application so that the data can stream.


When a user hits a link to an ASX file, the user's browser downloads the entire ASX file to the user's cache directory (don't worry, the files are tiny—about 1 Kb in size). Then the user's computer looks in its file associations table and sees that when it hits an ASX file it should launch the NetShow player. The NetShow player launches, looks in the ASX for instructions on where to get the ASF file, and starts the stream playing.

If you have an ASF file that you want users to be able to access on-demand, or in a unicast fashion, creating an ASX file is simple. Just go into your favorite text editor, such as Notepad, and type the following:

ASF Path

Where path is one of the following, depending on where you are streaming the content from:

Once you've entered this into Notepad, save the file as filename.asx. Check to make sure that the ASX is working by double-clicking on it in the Windows Explorer. It should bring up the NetShow player and start the content streaming.

Advanced ASX Files

One of the great new features of NetShow 2.0 is the ability to do protocol rollover. Protocol rollover allows you to try sending the ASF over a default protocol (like MMS using UDP from the NetShow server), and if it fails, it will try sending over an alternate server or protocol that you specify in the ASX file. This is especially convenient when you're worried about whether your content will get through customers' firewalls. You can set it up to try UDP first, and if that fails because the user's company doesn't accept UDP traffic through their corporate firewall, you can tell it to try the same content over HTTP or from a different server.

You can also specify a Base URL so that you can create NetShow content that uses URL flips, but that doesn't rely on the ASF being on one particular server. For example, if you created a great ASF that included URL flips to a specific directory on an HTTP server, if you wanted to be able to duplicate that content on another server and use protocol rollover to make it so if the first HTTP connection failed it automatically tried the second HTTP server, previously you would have had to rebuild the ASF with new hard-coded URL flips for every server. Now with NetShow 2.0, you simply specify a Base URL in the ASX file, and that allows you to move or duplicate the NetShow content to other servers with relative ease.

You can also insert the program title, description, author, and copyright information from the ASX. This information appears in the properties of the ASF when the user plays the file.

To take advantage of these advanced features, just go into Notepad and create and type the following lines that apply to what you are trying to do:

[Reference]
Ref1=mms://servername/path/asfname.asf (this is the first reference to try)
Ref2=http://servername/path/asfname.asf (this is the second refernece to try)
BaseURL = http://servername/path/dir/ (this is the Base URL for relative references in the ASF stream to use as a base path)

[Description]
Program Title=Title of the ASF here
Program Description=Description of your ASF here
Program Author=Your name here
Program Copyright=Copyright or other information here

Then just save this text file as asxname.asx and post to your HTTP server or network server as before. Also, note that above you do not need ref1 and ref2 if the virtual path is the same for both protocols. For example, if you had HTTP streaming enabled on the NetShow server or had a WWW virtual root that was the same the first REF1 would be enough with the protocol rollover feature of NetShow version 2.0 clients.

ASX Files for Multicast

There are two types of ASX files—hand crafted as discussed above, and machine generated. The machine generated are encrypted and they will allow you to publish an announcement that will support multicast. They are generated in the NetShow Program Manager and are created by right clicking on an existing NetShow program and choosing Announce. This will create an ASX file that you can link to in the stand alone player, use with an embedded object on an HTML document, use with a anchor tag in a HTML document, or distribute as appropriate. You need to use machine generated ASX files that are created from the Program Manager if you wish to multicast.

© 1997 Microsoft Corporation. All rights reserved. Legal Notices