Using Script Commands

[The feature associated with this page, Windows Media Format 11 SDK, is a legacy feature. It has been superseded by Source Reader and Sink Writer. Source Reader and Sink Writer have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use Source Reader and Sink Writer instead of Windows Media Format 11 SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The Windows Media Format SDK supports the use of script commands to communicate application actions in ASF files. Each script command is made up of two strings, the first string is the type of command, the second is the command data. For example, you can use the script type "URL" and pass a valid Internet URL as the command data. When a reading application that supports script commands of type "URL" receives this command, it will open the specified address in a browser window.

The Windows Media Format SDK provides two options for delivering script in ASF files. You can create a script stream or you can include script commands in the header of the file. Script streams are useful because the script commands are delivered in presentation time order. If you use script commands in the file header, your application will need to retrieve all of the script commands before starting playback. You must keep track of the presentation times of script commands and respond to them at the right time.

The following sections describe how to include script commands in an ASF file.

Section Description
To Use a Script Stream Describes how to include script commands in a script stream.
To Add Script Data to the Header Describes how to include script commands in the file header.
Using Script Commands Supported by Windows Media Player Describes the script commands used by Windows Media Player.

 

Note

In previous versions of the Windows Media Format SDK, script streams were used to open Web addresses corresponding to the content of an ASF file. You can now use Web streams to work with synchronized Web pages. For more information. see Web Streams.

 

Script Commands

Programming Guide