MediaContent

Source: MediaContent.js:48

This object contains a description of any multimedia content (sound, video, MIDI, voice
recording..) or special actions (jump to another point in the sequence, link to an URL, etc.)
associated to an ActiveBox object.


Constructor

new MediaContent(type: string, file?: string): MediaContent

MediaContent constructor

Parameters

  • type (string) — The type of media. Valid values are: UNKNOWN, PLAY_AUDIO, PLAY_VIDEO,
    PLAY_MIDI, PLAY_CDAUDIO, RECORD_AUDIO, PLAY_RECORDED_AUDIO, RUN_CLIC_ACTIVITY,
    RUN_CLIC_PACKAGE, RUN_EXTERNAL, URL, EXIT and RETURN
  • file (string, optional) — Optional parameter indicating the media file name

Instance Methods

setProperties($xml: external:jQuery)

Loads the MediaContent settings from a specific JQuery 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/MediaContent.MediaContent

Reads the properties of this MediaContent from a data object

Parameters

  • data (object) — The data object to be parsed

Returns

isEquivalent( mc: module:media/MediaContent.MediaContent, ): boolean

Compares this object with another MediaContent.

Parameters

Returns

  • boolean

getDescription(): string

Gets a string representing this media content, useful for checking if two different elements
are equivalent.

Returns

  • string

toString(): string

Returns a simplified description of this media content. Useful for accessibility methods.

Returns

  • string

getIcon(): external:HTMLImageElement

Returns an image to be used as icon for representing this media content.

Returns

Instance Fields

type: string

The type of media. Valid values are: UNKNOWN, PLAY_AUDIO, PLAY_VIDEO,
PLAY_MIDI, PLAY_CDAUDIO, RECORD_AUDIO, PLAY_RECORDED_AUDIO, RUN_CLIC_ACTIVITY,
RUN_CLIC_PACKAGE, RUN_EXTERNAL, URL, EXIT and RETURN

level: number

The priority level is important when different medias want to play together. Objects with
highest priority level can mute lower ones.

file: string

Media file name

externalParams: string

Optional parameters passed to external calls

from: number

Special setting used to play only a fragment of media. -1 means not used (plays full
length, from the beginning)

to: number

Special setting used to play only a fragment of media. -1 means not used (plays to the end
of the media)

length: number

When type is RECORD_AUDIO, this member stores the maximum length of the recorded
sound, in seconds.

recBuffer: number

When type is RECORD_AUDIO, this member stores the buffer ID where the recording
will be stored.

stretch: boolean

Whether to stretch or not the video size to fit the cell space.

free: boolean

When true, the video plays out of the cell, centered on the activity window.

absLocation: module:AWT.Point

Places the video window at a specific location.

absLocationFrom: string

When module:media/MediaContent.MediaContent#absLocation is not null, this field indicates from where to
measure its coordinates. Valid values are: BOX, WINDOW or FRAME.

catchMouseEvents: boolean

true when the video window must catch mouse clicks.

loop: boolean

Whether to repeat the media in loop, or just one time.

autoStart: boolean

When true, the media will automatically start playing when the associated ActiveBox
become active.

Static Fields

ICONS: object

Collection of icon external:HTMLImageElement objects