Embedding Sound in Web Pages, Part I: Navigator's LiveAudio Plug-in - Doc JavaScript
Navigator's LiveAudio Plug-in
Navigator uses the LiveAudio plug-in to play sound tracks embedded in Web pages. You can use the JavaScript's object associated with the EMBED
HTML element. On the Mac, calling JavaScript methods does not affect the buttons of the Navigator's control panel. Here are the methods supported by the EMBED
object:
Method | Description |
play( {loop [true |false |n ]}, URL) | Plays the soundtrack saved in the specified URL. The first parameter specifies whether to loop the sound track forever (true ), for a specified number of times (n ), or not at all (false ). Parameters are optional. The default for the first one is false . The default for the second one is the current object's sound track. The first parameter is mandatory on Mac (no default is supported). |
pause() | Pauses the sound track at the current position along the track. You can continue playing from the same spot by calling the play() method. |
stop() | Stops playing the sound and returns the track position to its beginning. You can start playing the sound again by calling the play() method. |
StopAll() | Stops all playing plug-ins. |
start_time(n) | Starts playing the audio track from a position that is n seconds from the beginning of the track. |
end_time(n) | Stops playing the audio track at a position that is n seconds from the beginning of the track. |
setvol(n) | Sets the volume at n percents of the maximum level (no % sign). |
fade_to(n) | Fades to a volume level that is n percents of the maximum level (no % sign). |
fade_from_to(n, m) | Fades from a volume level of n percents to a volume level of m percents (no % sign). |
start_at_beginning() | Starts playing at the beginning of the sound track. You can achieve this effect also by stopping the sound track and playing it again. This method overwrites the start_time() method. |
stop_at_end() | Stops playing at the end of the sound track. This method overwrites the end_time() method. |
The following methods are state indicators which do not control the plug-in but rather give its state:
Method | Description |
IsReady() | Returns true if the plug-in instance has completed loading, false otherwise. |
IsPlaying() | Returns true if the plug-in is currently playing the sound track, false otherwise. |
IsPaused() | Returns true if the plug-in is currently paused, false otherwise. |
GetVolume() | Returns the volume level in percents. |
Created: May 31, 1998
Revised: May 31, 1998
URL: https://www.webreference.com/js/column20/liveaudio.html