Rate this page:

PlayerEvents

Constants

Created

Copy URL

Triggered when Player created.

Parameters

  • player:

    Player

    Player that generated the event

Error

Copy URL

Triggered when playback has finished with an error

Parameters

  • error:

    string

    Error message

  • player:

    Player

    Player that generated the event

PlaybackBuffering

Copy URL

Triggered when an audio file is playing faster than it is being loaded.

Parameters

  • player:

    Player

    Player that generated the event

PlaybackFinished

Copy URL

Triggered when playback has finished successfully or with an error

Parameters

  • error:

    string

    Optional

    Optional. Error message

  • player:

    Player

    Player that generated the event

PlaybackMarkerReached

Copy URL

Triggered when Player.addMarker is reached

Parameters

  • offset:

    number

    The marker offset

  • player:

    Player

    Player that generated the event

PlaybackReady

Copy URL

Triggers by the createURLPlayer and createTTSPlayer methods when
1) the audio file download to the Voximplant cache is finished;
2) the audio file is found in the cache (i.e., it is in the cache before).

Parameters

  • player:

    Player

    Player that generated the event

Started

Copy URL

Triggered when playback is started. Note that if the createURLPlayer method is called with the onPause parameter set to true, the event is not triggered; it is triggered after the Player.resume method call.

Parameters

  • duration:

    number

    Playback duration

  • player:

    Player

    Player that generated the event

Stopped

Copy URL

Triggers as a result of the Player.stop method call.

Parameters

  • player:

    Player

    Player that generated the event