Multimedia Controls

Multimedia controls let us handle multimedia such as video and audio. The appearance of a multimedia control is much like the control panel of a CD player or video tape player:


	--------------------------------------------------------------
         |      |      |      |      |      |      |   _  |   _  |  __  |
         | |/|  | |\|  |  |\  |  ||  |  /|| |  ||\ |  | | |  | | |  /\  |
         | |\|  | |/|  |  |/  |  ||  |  \|| |  ||/ |  |_| |  |_| |  ==  |
         |      |      |      |      |      |      |      |      |      |
          --------------------------------------------------------------

Using these buttons, we can control various multimedia devices. Let's add a multimedia control like this to our Web page:

<HTML>
    <HEAD>
    <TITLE>OCX Control Page</TITLE>
    </HEAD>
    <BODY LANGUAGE = VBScript ONLOAD = "Page_Initialize">
    <CENTER>
    <H1>OCX Control Page</H1>
    </CENTER>
        .
        .
        .
    <!- MMControl>
    <PRE>
--> MMControl:  <OBJECT CLASSID="clsid:C1A8AF25-1257-101B-8FB0-0020AF039CA3"
                HEIGHT=50 WIDTH=400 ID=MMControl1></OBJECT>
    </PRE>
       .
       .
       .

To see this control at work, let's have it work with a music CD in your CD-ROM drive. We set the multimedia control's DeviceType to "CDAudio" and tell it to open the CD in the CD-ROM drive. We have given the multimedia control the ID MMControl1, so we add a button with the caption Activate MM Control to initialize the multimedia control in Page_Initialize:

<!- MMControl>
    <PRE>
    MMControl:  <OBJECT CLASSID="clsid:C1A8AF25-1257-101B-8FB0-0020AF039CA3"
                HEIGHT=50 WIDTH=400 ID=MMControl1></OBJECT>
    </PRE>
    <CENTER>
--> <INPUT TYPE = BUTTON NAME = "MMButton" VALUE = "Activate MM Control">
    </CENTER>
        .
        .
        .
    <SCRIPT LANGUAGE = VBScript>
            Sub Page_Initialize
                .
                .
                .
            End Sub
            Sub MMButton_OnClick
  -->             MMControl1.DeviceType = "CDAudio"
  -->             MMControl1.Command = "Open"
            End Sub
    </SCRIPT>
    </BODY>
    </HTML>

And that's it—when the user clicks the Activate MM Control button, the multimedia control's panel becomes active, and the user can use the buttons to play music from the CD-ROM drive. The multimedia control appears at the bottom of the Web page in Figure 6.2. We'll learn more about this powerful control soon; in the meantime, let's turn to spin buttons.

© 1996 by Steven Holzner. All rights reserved.