togglePlay method

Future<void> togglePlay()
inherited

播放或暂停

Play or pause

Implementation

Future<void> togglePlay() async {
  var __play = controllerWidgets ? play : videoCtrl.play;
  var __pause = controllerWidgets ? pause : videoCtrl.pause;

  // 等待Icon动画关闭
  // Wait for Icon animation to close
  if (_value.isPlaying) {
    await __pause();
  } else {
    await __play();
  }
}