fsplayer.api.SoundController Class

The SoundController class provides sound control facilities and exposes the following constants and methods:

Table 1. Constants
Constant Type Value Description
VOLUME_CHANGED String soundListener_onSoundVolumeChanged Defines the name of the sound volume changed event.
Table 2. Methods
Method Description
getVolume() Returns a numeric value defining current sound volume. Volume is a numeric value between 0 (minimal sound volume) and 1 (maximal sound volume).
setVolume(volume) Changes the sound volume. The volume parameter defines a new sound volume value which is a number between 0 (minimal volume) and 1(maximal volume).
onSoundVolumeChanged(volume) This method is invoked when sound volume is changed if the SoundController.VOLUME_CHANGED event handler is enabled. The default implementation of this method does nothing, however you can override it specifying your own handler funciton.
setSoundHandler(event) Enables the specified event handler. The following event parameter values are: fsplayer.api.SoundController.VOLUME_CHANGED
removeSoundHandler(event) Disables the specified event handler. The following event parameter values are: fsplayer.api.SoundController.VOLUME_CHANGED