togglePause method

void togglePause()

Implementation

void togglePause() {
  isPlaying ? pause() : play();
}