Constructor
new ActiveMediaPlayer(mc, mb, ps)
ActiveMediaPlayer constructor
Name | Type | Description |
---|---|---|
mc | module:media/MediaContent. |
|
mb | module:bags/MediaBag. | The project's MediaBag |
ps | module:JClicPlayer. | An object implementing the |
Members
$visualComponent :external:jQuery
The visual component for videos, usually a video
HTML element
bx :module:boxes/ActiveBox.ActiveBox
MediaPlayers should be linked to ActiveBox
objects.
mbe :module:bags/MediaBagElement.MediaBagElement
The module:bads/MediaBagElement.MediaBagElement
containing the reference to the media to be played
mc :module:media/MediaContent.MediaContent
The MediaContent associated to this player.
ps :module:JClicPlayer.JClicPlayer
The player to which this player belongs.
useAudioBuffer :boolean
When true
, this player makes use of a recording audio buffer
- boolean
(static) AUDIO_BUFFERS :Array.<external:AudioBuffer>
Audio buffers used for recording and playing voice are stored in a static array because
they are common to all instances of ActiveMediaPlayer
Only initialized when REC_ENABLED
is true
.
- Array.<external:AudioBuffer>
(static) REC_ENABLED :Boolean
Recording of audio is enabled only when navigator.getUserMedia
and MediaRecorder
are defined
In 02-Mar-2016 this is implemented only in Firefox 41 and Chrome 49 or later.
See: https://addpipe.com/blog/mediarecorder-api
- Boolean
Methods
checkVisualComponentBounds(_bxi)
Checks the position of visual components after a displacement or resizing of its container
Name | Type | Description |
---|---|---|
_bxi | module:boxes/ActiveBox. | The container where this player is hosted |
clear()
Frees all resources used by this player
clearAllAudioBuffers()
Clears all audio buffers
clearAudioBuffer(buffer)
Clears the specified audio buffer
Name | Type | Description |
---|---|---|
buffer | number | Index of the buffer in |
countActiveBuffers() → {number}
Counts the number of active audio buffers
- Type:
- number
linkTo(setBx)
Sets the ActiveBox associated to this media player
Name | Type | Description |
---|---|---|
setBx | module:boxes/ActiveBox. | The new container of this media. Can be |
play(setBxopt)
Plays the media when available, without blocking the current thread.
Name | Type | Attributes | Description |
---|---|---|---|
setBx | module:boxes/ActiveBox. | <optional> | The active box where this media will be placed (when video) |
playNow(_setBxopt)
Plays the media, realizing it if needed.
Name | Type | Attributes | Description |
---|---|---|---|
_setBx | module:boxes/ActiveBox. | <optional> | The active box where this media will be placed (when video) |
realize()
Generates the objects that will play media
setVisualComponentVisible(_state)
Sets the visual component of this player visible or invisible
Name | Type | Description |
---|---|---|
_state | boolean |
|
stop()
Stops the media playing
stopAllAudioBuffers()
Stops the playing or recording actions of all audio buffers
stopAudioBuffer(buffer)
Stops a specific audio buffer
Name | Type | Description |
---|---|---|
buffer | number | Index of the buffer in |