With the AVI file control, we can play .avi video files, allowing us to support video animation in our Web pages. We add an AVI file control to our Web page this way:
<HTML>
<HEAD>
<TITLE>OCX Control Page</TITLE>
</HEAD>
<BODY LANGUAGE = VBScript ONLOAD = "Page_Initialize">
<CENTER>
<H1>OCX Control Page</H1>
</CENTER>
.
.
.
<!- AVIfile>
<PRE>
AVIfile: [Free Floating] <OBJECT
--> CLASSID="clsid:00022602-0000-0000-C000-000000000046"
HEIGHT=50 WIDTH=50 ID=avi1></OBJECT>
</PRE>
.
.
.
This ActiveX control displays a control panel as shown in Figure 6.3 (this control panel appears in its own window on the screen). You can use the File menu to open a file of type .avi, such as skiing.avi, in the Windows\media directory (this file comes with Windows). After opening skiing.avi, you can use the buttons in the control panel to play the video, as in Figure 6.3. That's it—now we're playing videos from our Web page. Our Web page is a success.
Figure 6.3 Our AVI file control.
We're dealing with multimedia now, so let's turn to the multimedia control.