[Appendix H] LiveConnected Navigator Plug-Ins

Javascript: The Definitive Guide

Previous Appendix H Next
 

H. LiveConnected Navigator Plug-Ins

Contents:
LiveAudio
LiveVideo
Live3D

Netscape Navigator 3.0 ships (on some platforms, at least) with three built-in plug-ins that have support for LiveConnect. These plug-ins are LiveAudio, LiveVideo, and Live3D. Recall from Chapter 19, LiveConnect: JavaScript and Java that you can interact with plug-ins from JavaScript in the same way that you interact with Java applets. The sections below briefly describe the LiveConnect API provided by each of these plug-ins.

Note that this appendix does not provide full documentation for these plug-ins. In particular, it does not explain how to use the <EMBED> tag to embed data for these plug-ins into an HTML document. Some of these plug-ins define quite a few attributes for use with <EMBED> and have fairly complex HTML syntax. You can find details at:

http://home.netscape.com/comprod/products/navigator/version_3.0/development/

Once you understand how these various plug-ins work, this appendix should serve as a convenient reference to their LiveConnect APIs. It won't teach you about the plug-ins themselves, however.

H.1 LiveAudio

The LiveAudio plug-in plays audio files in most common formats, including AIFF, AU, MIDI, and WAV. It is bundled with Navigator 3.0 on Windows and Macintosh platforms. Its LiveConnect API consists of the following 14 methods:

end_time(seconds)

Specify the time at which the audio clip should stop playing. Calling this method overrides the STARTTIME attribute.

fade_from_to(from, to)

Fade the sound from the volume from to the volume to. Both volumes should be volume percentages expressed as integers between 0 and 100.

fade_to(volume)

Fade the sound to the specified volume. This argument specifies volume as a percentage of maximum volume and should be expressed as an integer between 0 and 100.

GetVolume()

Returns the current volume of the sound, as an integer between 0 and 100. This number represents a percentage of maximum volume.

IsPaused()

Returns true if the sound is paused; false otherwise.

IsPlaying()

Returns true if the sound is playing; false otherwise.

IsReady()

Returns true if the sound has completed loading and the plug-in is ready to play it.

pause()

Pause sound playing, without restarting at the beginning.

play(loop, url)

Play the sound specified by url. If loop is true, then the sound should be played over and over again continuously. If loop is false, then it should be played only once. Otherwise, if loop is an integer, it specifies the number of times that the sound should be played. This loop argument corresponds closely to the HTML LOOP attribute.

setvol(volume)

Sets the volume of the sound to volume. This argument represents the volume as a percentage of the maximum volume and should be expressed as an integer between 0 and 100.

start_at_beginning()

This method overrides the start_time() method or the STARTTIME HTML attribute and forces the sound to be played from the beginning.

stop()

Stop playing the sound.

StopAll()

Stop playing the sound and all other sounds controlled by the LiveAudio plug-in.

stop_at_end()

Calling this method overrides the end_time() method and the ENDTIME HTML attribute and forces the sound to be played all the way to the end.


Previous Home Next
JavaScript and HTML Color Names and Values Book Index LiveVideo