togglePlay method

void togglePlay()

切换播放

Implementation

void togglePlay() {
  if (_controller.value.isPlaying) {
    _controller.pause();
  } else {
    if (_isLive && _isReady) {
      seekTo(currentTime: 99999);
      play();
    } else {
      _controller.play();
    }
  }
  notifyListeners();
}