Windows Media Services SDK banner art
PreviousNext

About the DHTML Sample

The Dynamic HTML Sample consists of two Web pages, a series of GIF images, and the Clip1.asf file. The Default.htm page contains a Windows Media Player control, which starts playing Clip1.asf as soon as the page is opened, and various other frames and controls for displaying text and the DHTML events. A row along the lower section of the page displays your progress through the content. Click the Details buttons, which pop up in the row, to open a second page that displays the scripting used to implement the DHTML shown on the Default.htm page.

As Clip1.asf is played back, the Windows Media Player control reads script commands contained in the file, and sends them to the browser at the appropriate times. Each script command contains two text strings. The first string is passed to the browser in a ScriptCommand event as the variable bstrType; the second is passed as bstrParam.

When you click a Details button, one of the first lines in the JavaScript code is similar to if (bstrType = = “eventnumber1”). An If statement is the mechanism that is almost always used when handling script commands in a Web page. In this case, when bstrType is equal to eventnumber1, then the code within that If statement is executed.

The DHTML Sample also demonstrates how you can enhance the look of your Web page by the creative placement and graphic treatment of Windows Media Player. In this case, the Windows Media Player display and controls are hidden, and transport control methods are sent to it using JavaScript and a custom button bar.

Expanding on this Sample

DHTML provides you with a powerful tool for enhancing your Web site. For example, with Windows Media Technologies components and DHTML, you can do the following:

For more information, see Windows Media Presenter and Enhancing ASF content in the Windows Media Tools Documentation.

See Also

Using the DHTML Sample, Windows Media Technologies Solutions Samples

PreviousNext


© 1996-1999 Microsoft Corporation. All rights reserved.