|



| |
Goal (jumpstart 4 CD)
Create a simple ASX file to play Windows Media in the external Windows Media
Player.
Description
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.
More Details
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 (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:
<A HREF="http://webserver/path/yourfile.asx">Link to Streaming Content</A>
The browser will open this file and then launch the Windows Media Player to
play this content.
Code Examples
Here is the Basic syntax for an ASX file:
<ASX version = "3.0">
<TITLE>Simple ASX Demo</TITLE>
<ENTRY>
<TITLE>An Entry in a Simple ASX</TITLE>
<AUTHOR>Microsoft Corporation</AUTHOR>
<COPYRIGHT>(c)1999 Microsoft Corporation</COPYRIGHT>
<REF HREF = "mms://windowsmediaserver/path/yourfile.asf" />
</ENTRY>
</ASX>
Here's what each line does:
|
Line |
Description |
|
<ASX version = "3.0"> |
Identifier for the client (Windows Media
Player) that this is an ASX file. The attribute shown here is "version"
which is a required attribute specifying the version of the ASX. This
element is required. |
|
<TITLE>Simple ASX Demo</TITLE>
|
Identifies the title of the ASX file as
a whole. This information is displayed in the "Show" label of the Media
Player. |
|
<ENTRY> |
Begins the block entry element. An
<ENTRY> element is a way to define a particular clip in an ASX. |
|
<TITLE>An Entry in a Simple ASX</TITLE>
|
Identifies the title of the clip within
the ASX. It is different than the previous <TITLE></TITLE> pair because this
one is nested within an <ENTRY></ENTRY> block element. This information is
displayed in the "Clip" label of the Media Player. |
|
<AUTHOR>Microsoft Corporation</AUTHOR>
|
Identifies the author of the media clip,
similarly to the <TITLE></TITLE> pair. This information is displayed in the
"Author" label of the Media Player. |
|
<COPYRIGHT>(c)1999 Microsoft
Corporation</COPYRIGHT> |
Identifies the author of the media clip,
similarly to the <TITLE></TITLE> pair. This information is displayed in the
"Copyright" label of the Media Player. |
|
<!-- This is a comment. Change the
following path to point to your ASF --> |
Simple comment, in the same format as
HTML comments. |
|
<REF HREF = "mms://server/path/yourfile.asf"
/> |
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 Windows 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. |
|
</ENTRY> |
Specifies the end of the of the <ENTRY>
element. |
|
</ASX> |
Specifies the end of the ASX.
|
Browser Compatibility
Since ASXs work through a helper application, they are compatible with any
browser that supports helper applications.
| |
|