Java Reference
In-Depth Information
13
Using ActiveX and Plug-Ins
with JavaScript
Today's browsers provide a lot of built-in functionality; however, there are many things they can-
not do unaided, such as playing video or sound. Functionality of this sort is quite common on the
Internet, and plug-ins and their ability to extend browser functionality make it possible to enjoy a
richer web experience.
Plug-ins are downloaded applications and, as their name suggests, “plugged into” the browser.
Many different plug-ins exist today; the more common ones include Adobe Flash Player, Microsoft's
Silverlight, and Apple's QuickTime player.
Essentially, plug-ins are objects that encapsulate all the functionality they need to perform their
tasks, such as playing audio fi les, in a way that hides the complexity from the website author.
They are usually written in languages such as C++ and Java.
Plug-ins usually, but not always, have some sort of user interface. For example, the QuickTime plug-in
has a user interface that displays buttons to play/pause the audio or video fi le, a seek bar to go to a
precise point in the playback, and a volume control (see Figure 13-1).
Figure 13-1
Some plug-ins make objects with various methods and properties available to you to access with
JavaScript, much as you access the methods and properties of the window object or the Document
Object Model. For example, the QuickTime player plug-in exposes the Play() method that you
can use to play a sound or video clip.
Plug-ins have been around for quite some time; in fact, Netscape supported them as early as ver-
sion 3. You probably won't be shocked to fi nd out that Microsoft does things differently from the
other browser makers. Internet Explorer (IE) does not support plug-ins, but IE 4.0+ running on
Windows does support ActiveX controls, which provide the same functionality.
Search WWH ::




Custom Search