media/MediaContent. MediaContent

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

MediaContent constructor

Parameters:
NameTypeAttributesDescription
typestring

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

filestring<optional>

Optional parameter indicating the media file name

Members

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.

Type:
  • string

autoStart :boolean

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

Type:
  • boolean

catchMouseEvents :boolean

true when the video window must catch mouse clicks.

Type:
  • boolean

externalParams :string

Optional parameters passed to external calls

Type:
  • string

file :string

Media file name

Type:
  • string

free :boolean

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

Type:
  • boolean

from :number

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

Type:
  • number

length :number

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

Type:
  • number

level :number

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

Type:
  • number

loop :boolean

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

Type:
  • boolean

recBuffer :number

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

Type:
  • number

stretch :boolean

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

Type:
  • boolean

to :number

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

Type:
  • number

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

Type:
  • string

(static) ICONS :object

Collection of icon external:HTMLImageElement objects

Type:
  • object

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

getDescription() → {string}

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

Returns:
Type: 
string

getIcon() → {external:HTMLImageElement}

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

isEquivalent(mc) → {boolean}

Compares this object with another MediaContent.

Parameters:
NameTypeDescription
mcmodule:media/MediaContent.MediaContent

The Media Content to compare against to.

Returns:
  • true when both objects are equivalent.
Type: 
boolean

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

Reads the properties of this MediaContent from a data object

Parameters:
NameTypeDescription
dataobject

The data object to be parsed

setProperties($xml)

Loads the MediaContent settings from a specific JQuery XML element

Parameters:
NameTypeDescription
$xmlexternal:jQuery

toString() → {string}

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

Returns:
Type: 
string