togglePlay( )


Toggles playback.

The togglePlay() function either pauses or plays the current playback based on its current state:

  • If the playback is paused, it plays and a play event is fired. The play event handlers set on the audio player by the onPlay( ) function are called.
  • If the playback is playing, it is paused and a pause event is fired. The pause event handlers set on the audio player by the onPause( ) function are called.
Method Declaration
Copy
Request
This method does not take any parameters
Was this helpful?
Yes
No