media/EventSoundsElement. EventSoundsElement

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, fileopt)

EventSoundsElement constructor

Parameters:
NameTypeAttributesDescription
idstring

The identifier of this media sound

filestring<optional>

An optional file name or URL containing the sound data

Members

audio :external:HTMLAudioElement

HTMLAudioElement used to play this sound

enabled :number

Whether the sound for this event is enabled or not

Type:
  • number

file :string

The name of the sound file used by this element

Type:
  • string

player :module:media/ActiveMediaPlayer.ActiveMediaPlayer

Media player used to play this sound

Methods

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:
  • The resulting object, with minimal attrributes
Type: 
object

play()

Plays the audio associated to this event

realize(ps, mediaBag)

Instantiates this audio object

Parameters:
NameTypeDescription
psmodule:JClicPlayer.JClicPlayer
mediaBagmodule:bags/MediaBag.MediaBag

setAttributes(data) → {module:media/EventSoundsElement.EventSoundsElement}

Reads the properties of this EventSoundsElement from a data object

Parameters:
NameTypeDescription
dataobject

The data object to be parsed

setProperties($xml)

Reads the properties of this object from an XML element

Parameters:
NameTypeDescription
$xmlexternal:jQuery

The XML element to be parsed

stop()

Stops playing the audio associated to this event