Windows Media : URL Events with an External Player
Goal: To use the URL event in ASF file to flip URLs into your default browser.
ITPro Today
February 18, 2002
2 Min Read
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.
Microsoft Corporation(c)1999 Microsoft CorporationYou'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.
About the Author
Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
You May Also Like