toggle method

void toggle(
  1. FijkPlayer? player
)

视频切换

Implementation

void toggle(FijkPlayer? player) {
  if (player?.state == FijkState.started) {
    player?.pause();
    CloudEBus.instance.dispatch("playIconSetting", params: true);
  } else if (player?.state == FijkState.prepared ||
      player?.state == FijkState.paused ||
      player?.state == FijkState.completed) {
    player?.start();
    CloudEBus.instance.dispatch("playIconSetting", params: false);
  }
}