SequencePlayer
Represents an instance with segments represented by audio and URL players.
Can be used by calling the VoxEngine.createSequencePlayer method.
Methods
addEventListener
addEventListener(event: , callback: Function
): void
Adds a handler for the specified SequencePlayerEvents event. Use only functions as handlers; anything except a function leads to the error and scenario termination when a handler is called
Parameters
event:
Event class (i.e., SequencePlayerEvents.PlaybackFinished)
callback:
Function
Handler function. A single parameter is passed - object with event information
Returns
type:
void
addMarker
addMarker(offset: number
, segment: ): void
Adds a playback marker to the specified segment. The SequencePlayerEvents.PlaybackMarkerReached event is triggered when the marker is reached.
Parameters
offset:
number
Positive/negative offset (ms) from the start/end of media.
segment:
The segment to add the marker.
Returns
type:
void
id
id(): string
Returns the sequence player's id.
Returns
type:
string
pause
pause(): void
Pauses playback. To continue the playback use the SequencePlayer.resume method.
Returns
type:
void
removeEventListener
removeEventListener(event: , callback: Function
): void
Removes a handler for the specified SequencePlayerEvents event
Parameters
event:
Event class (i.e., SequencePlayerEvents.PlaybackFinished)
callback:
Function
OptionalHandler function. If not specified, all event listeners are removed
Returns
type:
void
resume
resume(): void
Resumes playback after the SequencePlayer.pause method is called.
Returns
type:
void
sendMediaTo
sendMediaTo(mediaUnit: , parameters: ): void
Starts sending media (voice and video) from this call to the media unit specified in targetMediaUnit. Each call can send media to any number of other calls, but can receive from just one. So if targetCall is already receiving media from another call, that link would break.
Parameters
mediaUnit:
Media unit that receives media.
parameters:
OptionalCustom parameters for WebSocket interaction only.
Returns
type:
void
stop
stop(): void
Stops playback. The current sequence player's instance with all its segments is destroyed.
Returns
type:
void
stopMediaTo
stopMediaTo(mediaUnit: ): void
Stop sending media (voice and video) from this call to media unit specified in targetMediaUnit.
Parameters
mediaUnit:
Media unit that does not need to receive media from this conference anymore.
Returns
type:
void