togglePlay method

Future<void> togglePlay()

toggle play the current video

Implementation

Future<void> togglePlay() async {
  if (playerStatus.playing) {
    pause();
  } else {
    play();
  }
}