Windows Media : URL Events with an External Player

Goal: To use the URL event in ASF file to flip URLs into your default browser.

ASF and the Windows Media Player have the ability to send URLs to the browser. This demo will demonstrate how to send URL flips to a browser from the standalone player.

More Details
The BASE element in the ASX file needs to have a fully qualified URL. Code to Include Link to Streaming Content

Since we're doing this in the external player, we're going to use an ASX file to play the content.

<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"></ref></entry></asx> You'll notice that we've added a new ASX Element, the element. This simply points to the default location of your slides. Doing this allows you to keep a relative path in your ASF URL events, so that if the slides move, you only need to update the ASX, not the entire ASF.

Since the URL event is handled instrinsically by the player, we won't need any JavaScript for this sample. Simply add the URL events to the ASF file.

First, open up the ASF Indexer -- the default location of this tool is Start -> Programs -> Windows Media -> ASF Indexer. Once it is running, select File -> Open. This will bring up a dialog box which will allow you to specify a piece of ASF content. Click on the "Edit Script Commands" button. This will bring up the "Script Commands" dialog box. Click on "New." Choose a time for you script command (in hours:minutes:seconds.tenths format) and leave the "type" of script command as "URL."

The parameter field is where you reference your HTML (or image) file in the following format: your-file.extensionandandFrame-name, where your-file.extension is the name of you file. Frame-name will allow you to specify a name for your frame. In our example, we'll be using leftFrame (capitalization counts). When you're done, click on "OK."

Your ASF Indexer should look something like this:

Repeat this process for all of your URL events, click on "OK," and then File -> Save. You have now created script commands in your ASF file.

Browser/Platform Compatibility
This code will work with Internet Explorer 4+, and Netscape Navigator 4+ on platforms that support the Windows Media Player plug-in and ActiveX control.
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