EventSoundsElement
Source: EventSoundsElement.js:41
The EventSoundsElement object contains the description of a specific sound to be played when
one of the JClic events are fired.
For a full list of the JClic events see: EventSounds
Constructor
new EventSoundsElement(
id: string,
file?: string,
): EventSoundsElementEventSoundsElement constructor
Parameters
id(string) — The identifier of this media soundfile(string, optional) — An optional file name or URL containing the sound data
Instance Methods
setProperties($xml: external:jQuery)
Reads the properties of this object from an XML element
Parameters
$xml(external:jQuery) — The XML element to be parsed
getAttributes(): object
Gets a object with the basic attributes needed to rebuild this instance excluding functions,
parent references, constants and also attributes retaining the default value.
The resulting object is commonly usued to serialize elements in JSON format.
Returns
object
setAttributes(
data: object,
): module:media/EventSoundsElement.EventSoundsElement
Reads the properties of this EventSoundsElement from a data object
Parameters
data(object) — The data object to be parsed
Returns
realize(
ps: module:JClicPlayer.JClicPlayer,
mediaBag: module:bags/MediaBag.MediaBag,
)
Instantiates this audio object
Parameters
ps(module:JClicPlayer.JClicPlayer)mediaBag(module:bags/MediaBag.MediaBag)
play()
Plays the audio associated to this event
stop()
Stops playing the audio associated to this event
Instance Fields
file: string
The name of the sound file used by this element
enabled: number
Whether the sound for this event is enabled or not
player: module:media/ActiveMediaPlayer.ActiveMediaPlayer
Media player used to play this sound
audio: external:HTMLAudioElement
HTMLAudioElement used to play this sound