Player
Represents an audio player.
Methods
addEventListener
addEventListener(event: , callback: Function
): void
Adds a handler for the specified PlayerEvents 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., PlayerEvents.PlaybackFinished)
callback:
Function
Handler function. A single parameter is passed - object with event information
Returns
type:
void
addMarker
addMarker(offset: number
): void
Add playback marker. The PlayerEvents.PlaybackMarkerReached event is triggered when the marker is reached.
Parameters
offset:
number
Positive/negative offset (ms) from the start/end of media.
Returns
type:
void
id
id(): string
Returns player id.
Returns
type:
string
pause
pause(): void
Pause playback. To continue playback use the Player.resume method.
Returns
type:
void
removeEventListener
removeEventListener(event: , callback: Function
): void
Removes a handler for the specified PlayerEvents event
Parameters
event:
Event class (i.e., PlayerEvents.PlaybackFinished)
callback:
Function
OptionalHandler function. If not specified, all event listeners are removed
Returns
type:
void
sendMediaTo
sendMediaTo(mediaUnit: , optional: ): void
Start sending media (voice and video) from this call to 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.
optional:
OptionalCustom parameters for WebSocket interaction only.
Returns
type:
void
stop
stop(): void
Stops playback. The current player's instance 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 receive media from this conference anymore.
Returns
type:
void