Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
Occurs when the Microsoft Windows Media Player control receives a synchronized command or URL.
Compatibility:Windows Media Player
<SCRIPT FOR="MediaPlayer" EVENT="ScriptCommand( sType , sParam )" LANGUAGE="JScript"> //insert script commands// </SCRIPT>
Parameters
Remarks
Commands can be embedded among the sounds and images of an .asf file. A command is a pair of Unicode strings associated with a designated time in the stream. When the stream reaches the time associated with the command, the Windows Media Player control sends a ScriptCommandevent with two parameters. The sTypeparameter specifies the type of command and the sParamparameter specifies the command. The type parameter determines how the Windows Media Player control processes the command parameter. Any type of command can be embedded in an ASF stream to be handled by the ScriptCommandevent.
One type of command is a URL (Uniform Resource Locator). The Windows Media Player control automatically invokes URL-type commands in your default browser if the InvokeURLsproperty is true.
The Windows Media Player control always processes incoming URL-type commands in the following manner:
The control receives the embedded script command.
The ScriptCommand event occurs.
If InvokeURLsis true and the command is a URL-type, the control invokes the specified URL. If the command is a URL-type but InvokeURLsis false, the command is ignored.
All other event types are processed by the Media Player by default.
When you author an .asf file, you can specify the frame in which the new URL is displayed by appending two ampersands and the name of the frame in the parameter field. The example below illustrates typical ScriptCommand parameters. It specifies that the URL mypagewill be launched in the frame myframe.
Type = "URL" Param ="http://example.microsoft.com/mypagel&&myframe"
Other types of script commands automatically processed by the Windows Media Player control include FILENAME, TEXT, EVENT, and OPENEVENT commands. For the FILENAME type, the Windows Media Player control resets the FileNameproperty, attempts to open the specified file, and begins playing the new stream immediately. For the TEXT type, the Windows Media Player control displays the associated text in the captioning window of the Windows Media Player. For the EVENT type, the Windows Media Player control executes instructions defined for the specified event. For the OPENEVENT type, the Windows Media Player buffers the associated EVENT-type command for execution when it receives the corresponding EVENT from the ASF stream.
You can embed any other type of command as long as you provide corresponding code to handle it. The Windows Media Player control ignores unknown command types, but still hands them off to the ScriptCommand event.
This event does not occur if the file is being scanned (fast-forwarded or fast-reversed).