Script Option


Use the -script command option to insert markers, content information, and script commands into an .asf file. Markers are pointers to specific points in time in the .asf file. When a viewer is playing an .asf file, she can use the Next Marker button and Previous Marker button to jump to the markers in the .asf file. Script commands are commands that are included in the Active Streamuing Format and delivered to the client. NetShow Player passes the script commands to a device or application that interprets the commands.

You can have a marker section and a script commands section in one script file. If you use both a marker and a script commands section, be sure to correctly start and end each section. The first lines of the marker and script sections must begin with start_marker_table and start_script_table, respectively. Incorporate markers and script commands into the .asf file during the build process by specifying the -script option and naming the script file:

vidtoasf -in filename.avi -script script.txt -out filename.asf

The following sections describe how to create marker and string command sections. In a script file, lines that begin with semicolons are treated as comments. Blank lines and extra white space are generally ignored. The exception is when the white space appears in a marker name, a URL, or within a script command parameter. Specify the time for markers and URLs in the hh:mm:ss.t format, where h = hours, m = minutes, s = seconds, and t = tenths of seconds. When identifying times, specify times in terms of the source file.

Markers

A marker is a pointer to a specific time in an .asf file. NetShow Player uses markers to seek directly to a point in an .asf file. Markers make it possible for viewers to maneuver through an .asf file any way they want. A user can skip ahead or skip back to a previous marker to view a portion of the .asf file again.

To create a marker in a script file, specify the time where you want to set the marker, and name the marker. You can name the markers anything you like. A marker script file should look something like this:


; Sample Marker script.txt
start_marker_table
8 Marker 1
1:00 Marker 2
1:15 Marker 3
3:00:03 Marker 4
end_marker_table

Script Commands

Insert script commands into an .asf file the same way you would insert markers, by using the -script option and a text file. The two sections below show examples of scripting and URL flipping and captioning. URL flipping works fine by itself, but other script commands require client-side assistance. The captioning in the second example below will require some client-side assistance. For information on how to provide client-side assistance for script commands, see the ScriptCommand Event in the NetShow Player SDK.


; This is how you put content information into your .asf
; file when using vidtoasf or wavtoasf.
Title: This is the title
Author: ASF Maker
Copyright: 1997
Description: text that describes the .asf file
Rating: PG

; Demonstration of URL flipping and captioning
start_script_table
1.0 URL http://NetShow/images/austr1.html&&Display
5.0 Caption  Sydney Opera House
12.0 URL http://NetShow/images/austr2.html&&Display
15.0 Caption  A nice beach north of Cairnes
32.0 URL http://NetShow/images/austr3.html&&Display
35.0 Caption  Australia's rain forest
end_script_table

Note In the example above, && is used to indicate the frame in a Web page where the URL should appear.

A URL script command differs a little from a marker. At the time specified, NetShow Player tells the default browser to find the specified URL address. For this to work properly, the browser must be able to access the URL. Be aware that if you include a URL that doesn't exist, the browser will return an error.

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.