SIGN UP

Player

Methods

addEventListener(playerevent: Function, handler: Function): void

Adds handler for specific event generated by Player. Use only functions as handlers; anything except a function leads to the error and scenario termination when a handler will be called.

Parameters

  • playerevent:

    Function

    Event class (i.e., PlayerEvents.PlaybackFinished)

  • handler:

    Function

    Handler functшкion. A single parameter is passed - object with event information

Returns

  • Return:

    void
addMarker(offset: Number): void

Add playback marker. The PlayerEvents.PlaybackMarkerReached event will be triggered when the marker is reached.

Parameters

  • offset:

    Number

    Positive/negative offset (ms) from the start/end of media.

Returns

  • Return:

    void

Examples

request:

Playback marker from 1 sec from the start

 player.addMarker(1000);

Playback marker from 2 sec from the end

 player.addMarker(-2000);
pause(): void

Pause playback. To continue playback use the Player.resume method.

Returns

  • Return:

    void
removeEventListener(playerevent: Function, handler: Function): void

Removes handler for specific event generated by Player

Parameters

  • playerevent:

    Function

    Event class (i.e., PlayerEvents.PlaybackFinished)

  • handler:

    FunctionOptional

    Handler function. If not specified, all event listeners are removed

Returns

  • Return:

    void
resume(): void

Resume playback after the Player.pause method was called.

Returns

  • Return:

    void
sendMediaTo(targetMediaUnit: Call|Conference|ASR|Recorder): 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 was already receiving media from another call, that link would break.

Parameters

Returns

  • Return:

    void
stop(): void

Stops playback. The current player's instance will be destroyed.

Returns

  • Return:

    void
stopMediaTo(targetMediaUnit: Call|Conference): void

Stop sending media (voice and video) from this call to media unit specified in targetMediaUnit.

Parameters

  • targetMediaUnit:

    Call|Conference

    media unit that will not receive media from this call anymore.

Returns

  • Return:

    void