Windows Media : Simple ASX

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.

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 (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:

<br><a href="http://webserver/path/yourfile.asx">Link to Streaming Content</a> <br> The browser will open this file and then launch the Windows Media Player to play this content. <br><br><b examples><br> Here is the Basic syntax for an ASX file: <br><br><asx version="3.0"><br><title>Simple ASX Demo</title> <br><entry><br><title>An Entry in a Simple ASX</title> <br><author>Microsoft Corporation</author><br><copyright>(c)1999 Microsoft Corporation</copyright><br><ref href="mms://windowsmediaserver/path/yourfile.asf"></ref><br></entry><br></asx><br><br> Here's what each line does: Line Description <br><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. <br><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.<br><entry> Begins the block entry element. An <entry> element is a way to define a particular clip in an ASX.<br><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. <br><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.<br><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. <br><!-- 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"></ref> 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. <br> Remember that ASF files on your media server are not usually kept in the same location as your HTML documents.<br><br><b>Note:</b> 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. <br><br></entry> Specifies the end of the of the <entry> element. <br></entry></entry></asx> Specifies the end of the ASX. <br></b>

Browser/Platform Compatibility

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.

Complete Article

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish