Fires when the Microsoft® Windows® Media Player control receives a synchronized command or URL.
Syntax
Inline HTML <ELEMENT onscriptcommand = "handler" ... > All platforms Event property object.onscriptcommand = handler JScript (compatible with ECMA 262 language specification) only Named script <SCRIPT FOR = object EVENT = onscriptcommand> Internet Explorer only
Remarks
Bubbles No Cancels No To invoke Open a document in the browser that plays a streaming media file affected by HTML+TIME. The streaming media file (.asf) must contain embedded commands, or triggers, in the stream. Default action Calls the associated event handler. This event fires when the Windows Media Player is used with one of the HTML+TIME media elements, including ANIMATION, AUDIO, IMG, MEDIA, and VIDEO.
Commands can be embedded among the sounds and images of an .asf file. A command consists of 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 fires this event and sets two properties on the event object, the scType property and the Param property. The scType property specifies the type of command, and the Param property specifies the command value. The scType property 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 this event. For example, if the Windows Media Player encounters a URL trigger in the .asf file, the scType property is set to URL and the Param property is set to URL (http://...). For more information about how this event works with the Media Player, see the Windows Media Player .
In addition to the onscriptcommand event, a second event is fired in response to the .asf trigger. The event prefix on is added to the front of the string specified in the scType property, and that event is fired. For example, suppose a stream defines a trigger with the scType property set to the string mytype. In this case, the custom onmytype event fires at that point in the stream with the onscriptcommand.
Event Object Properties
Although event handlers in the Dynamic HTML (DHTML) Object Model do not directly receive parameters, the handler can query the event object for data. For a list of properties of the event object relevant to an onscriptcommand event handler, click the following link.
Param Retrieves a string representing the value of the trigger encountered in the streaming media file. scType Retrieves a string representing the type of trigger encountered in the streaming media file. srcElement Retrieves the object that fired the event. type Retrieves the event name from the event object. To access the Param and scType values, use the getAttribute method on the window.event object.
Applies To
animation, audio, img, media, video