Skip to navigation

SequencePlayer

Represents an instance with segments represented by audio and URL players. Can be created by calling the VoxEngine.createSequencePlayer method.
View as Markdown

Methods

addEventListener

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.

addEventListener(event: SequencePlayerEvents | T, callback: (event: _SequencePlayerEvents[T]) => any): void

Parameters

event
SequencePlayerEvents | TRequired
callback
(event: _SequencePlayerEvents[T]) => anyRequired

addMarker

Adds a playback marker to the specified segment. The SequencePlayerEvents.PlaybackMarkerReached event is triggered when the marker is reached.

addMarker(offset: number, segment: PlaybackParameters): void

Parameters

offset
numberRequired
segment
PlaybackParametersRequired

id

Returns the sequence player’s id.

id(): string

pause

Pauses playback. To continue the playback use the SequencePlayer.resume method.

pause(): void

removeEventListener

Removes a handler for the specified SequencePlayerEvents event.

removeEventListener(event: SequencePlayerEvents | T, callback?: (event: _SequencePlayerEvents[T]) => any): void

Parameters

event
SequencePlayerEvents | TRequired
callback
(event: _SequencePlayerEvents[T]) => any

resume

Resumes playback after the SequencePlayer.pause method is called.

resume(): void

sendMediaTo

Starts sending media from the sequence player to the media unit.

sendMediaTo(mediaUnit: VoxMediaUnit, parameters?: SendMediaParameters): void

Parameters

mediaUnit
VoxMediaUnitRequired
parameters
SendMediaParameters

stop

Stops playback. The current sequence player’s instance with all its segments is destroyed.

stop(): void

stopMediaTo

Stops sending media from the sequence player to the media unit.

stopMediaTo(mediaUnit: VoxMediaUnit): void

Parameters

mediaUnit
VoxMediaUnitRequired