ActiveMediaBag
Source: ActiveMediaBag.js:39
This class stores a collection of realized ActiveMediaPlayer objects, related to a
JClicProject or Activity.
Constructor
new ActiveMediaBag(): ActiveMediaBagActiveMediaBag constructor
Instance Methods
createActiveMediaPlayer(
mc: module:media/MediaContent.MediaContent,
mb: module:bags/MediaBag.MediaBag,
ps: module:JClicPlayer.JClicPlayer,
): module:media/ActiveMediaPlayer.ActiveMediaPlayer
Creates a new ActiveMediaPlayer linked to this media bag
Parameters
mc(module:media/MediaContent.MediaContent) — The content used by the new playermb(module:bags/MediaBag.MediaBag) — The project's MediaBagps(module:JClicPlayer.JClicPlayer) — An object implementing the
PlayStation interface,
usually a JClicPlayer.
Returns
getActiveMediaPlayer(
mc: module:media/MediaContent.MediaContent,
mb: module:bags/MediaBag.MediaBag,
ps: module:JClicPlayer.JClicPlayer,
): module:media/ActiveMediaPlayer.ActiveMediaPlayer
Looks for an already existing ActiveMediaPlayer equivalent to the requested.
When not found, a new one is created and and returned.
Parameters
mc(module:media/MediaContent.MediaContent) — The content used by the new playermb(module:bags/MediaBag.MediaBag) — The project's MediaBagps(module:JClicPlayer.JClicPlayer) — An object implementing the
PlayStation interface,
usually a JClicPlayer.
Returns
removeActiveMediaPlayer(
mc: module:media/MediaContent.MediaContent,
)
Removes from the list of players the ActiveMediaPlayer related to the specified module:media/MediaContent.MediaContent.
Parameters
mc(module:media/MediaContent.MediaContent) — The media content to look for.
realizeAll()
Realizes all the media elements stored in this bag
stopAll(level: number)
Stops playing all media elements stored in this bag
Parameters
level(number) — Level at and below what all media players will be muted.
removeAll()
Removes all players from this media bag
Instance Fields
players: Array.<module:media/ActiveMediaPlayer.ActiveMediaPlayer>
The collection of ActiveMediaPlayer objects stored in this media bag.