Microsoft DirectX 9.0

Embedding the Video Control in a Web Page

This topic applies to Windows XP only.

Use the OBJECT tag to embed the Video Control in a Web page. You can specify either the CLASSID attribute or the DATA attribute, as follows:

With the CLASSID attribute, the Video Control is created but does not tune to any program. It appears as a blank video rectangle until the Video Control receives a tune request through script. With the DATA attribute, the Video Control automatically tunes to the default tune request specified in the system registry (if any).

The default tune request must be created using C++.  Script-based applications cannot access the system registry. The default tune request might be created during the installation process for a particular device or service, or by a C++ application. For more information, see ICreatePropBagOnRegKey.

The Video Control appears as a visible rectangle on the display, so it should be embedded and positioned inside the BODY tag of the Web page. To specify the dimensions of the rectangle, use the WIDTH and HEIGHT attributes, as shown in the following example:

<OBJECT DATA="tv:" WIDTH="320" HEIGHT="280"></OBJECT>

To tune to a program, call the View method on the MSVidCtl object.

dim objTuneRequest  ' Tune Request
' Create the tune request (not shown)
MSVidCtl.View objTuneRequest

For information about creating a tune request object, see Creating Tune Requests (Script).

To begin viewing the program, call the Run method:

MSVidCtl.Run