JavaScript: The Definitive GuideJavaScript: The Definitive GuideSearch this book

14.10. Embedded Data

The embeds[] array contains objects that represent data (other than applets) embedded in the document with the <embed> or <object> tag. Embedded data can take many forms (audio, video, spreadsheets, etc.). The browser must have an appropriate viewer installed or available so that it can display the data to the user. In Netscape, special modules known as plugins are responsible for displaying embedded data. In Internet Explorer, embedded data is displayed by ActiveX controls. Both plugins and ActiveX controls can be automatically downloaded from the network and installed as needed.

While the elements of the applets[] array all represent Java applets, the elements of the embeds[] array tend to be more diverse, and few generalizations can be made about them. The properties and methods of these objects depend upon the particular plugin or ActiveX control that is used to display the embedded data. You should consult the vendor-specific documentation for the plugin or ActiveX control you are using. If it supports any kind of scripting from JavaScript, the documentation should say so, and it should describe the properties and methods that you can use from JavaScript. For example, the documentation for the LiveVideo plugin from Netscape says that the LiveVideo object in the embeds[] array supports four methods: play( ), stop( ), rewind( ), and seek( ). With this information, you can write simple scripts that control how the plugin displays a movie you have embedded on a web page. Note that while some vendors may produce plugins (for Netscape) and ActiveX controls (for IE) that define the same public API, this is not always the case, and scripting embedded objects usually involves platform-specific JavaScript code.



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.