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, ): EventSoundsElement

EventSoundsElement constructor

Parameters

  • id (string) — The identifier of this media sound
  • file (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

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

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