From PanoZona
BackgroundMusic |
Author | Marek Standio |
Module version | 1.2 |
Compatibility | SaladoPlayer 1.0 + |
BackgroundMusic is simple module for playing music in background. You can easily asign different sound files to be played in different panoramas, module can also cooperate with other modules such like ButtonBar or ImageButton.
Configuration structure
Configuration details
BackgroundMusic
Attribute | Type | Sub-attribute | Type | Default | Values | Description |
path | S | - | - | path to swf file | Mandatory attribute. Value points to module swf file. |
settings
Attribute | Type | Sub-attribute | Type | Default | Values | Description |
play | B | - | false | true, false | Determines if current track is played whenever module is loaded. |
onPlay | S | - | - | action id | Action executed when music starts playing. |
onStop | S | - | - | action id | Action executed when music stops playing. |
track
Attribute | Type | Sub-attribute | Type | Default | Values | Description |
id | S | - | - | - | Mandatory attribute. Id of track, must be unique among other tracks. |
path | S | - | - | path to sound file | Mandatory attribute. Points to *.mp3 file used by given track. |
volume | N | - | 1.0 | 0.0 to 1.0 | Volume of played sound file. |
loop | B | - | true | true, false | Determines if sound file is repeated after it finishes playing. |
next | S | - | - | track id | If track loop attribute is set to false you can determine which track is played when given track finishes playing. |
sound
Attribute | Type | Sub-attribute | Type | Default | Values | Description |
id | S | - | - | - | Mandatory attribute. Id of sound, must be unique among other sounds. |
path | S | - | - | path to sound file | Mandatory attribute. Points to *.mp3 file used by given track. |
volume | N | - | 1.0 | 0.0 to 1.0 | Volume of played sound file. |
Functions
setTrack
Type | Description | Function description |
S | track id | Function is used to set "current" track. If music is playing, changing track results in playing different sound file. If music is stopped, setting track changes sound file that will be played when users starts playing music. By default first track in configuration is used as "current" track. |
setPlay
Type | Description | Function description |
B | value | Function is used for stopping and starting playing "current" track. |
togglePlay
Type | Description | Function description |
- | - | If music is playing, calling this functions stops it. Similarly, when music is stopped, calling this function starts playing "current" track. |
playSound
Type | Description | Function description |
S | sound id | Function is used to play single sound of given id. |