Goal: To use the TEXT event in an ASF file to add captioning support for both Microsoft Internet Explorer and Netscape Navigator.
ASF has the ability to send script command events to the browser. The TEXT script command event will add HTML markup directly into the Media Player's captioning window. By doing this, you can quickly and easily add accessibility support, as well as include additional, time-based data within the ASF file.
TEXT script command events are intrinsically handled by the Windows Media Player, like URL script command events. Instead of grabbing a new document, the TEXT script command event replaces the HTML markup in the captioning window with new text.
Code to Include
This file will use our generic cross-browser code embedding code. This code will instantiate the Media Player ActiveX control for browsers which support ActiveX, and the Media Player plug-in for browsers that don't:
We'll even link to the file in an external player for downlevel browsers.
Open External Player
The above code may not work properly with Netscape Naviagor. Use the following code instead with Netscape.
Open External Player
This code stops the Media player (two media players playing at once can be quite distracting), and then opens the ASX file, which spawns the Media Player stand-alone application.
And here is the ASX syntax:
External Captioning DemoCaptioning DemoYour Author InfoYour Copyright info
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 the "Edit Script Commands" button. This will bring up the "Script Commands" dialog box. Click "New." Choose a time for your script command (in hours:minutes:seconds.tenths format) and specify the "Type" of script command as "TEXT."
The parameter field is where you can put your HTML markup. Note that for each 1/10 second interval, there is a maximum of approximately 230 characters. If your markup is longer than that, it will be truncated to fit in the available space.
Your ASF Indexer should look something like this:
Repeat this process for all of your TEXT events, click "OK," and then File->Save. Now you have created TEXT script commands in your ASF file.
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.