play method

bool play()

Play the current media file.

If the the player is opening a media file, calling this method will set autoplay to true

Implementation

bool play() {
  if (speed.value > 0) {
    if (id.value != null && playbackState.value == PlaybackState.paused) {
      _methodChannel.invokeMethod('play', id.value);
      playbackState.value = PlaybackState.playing;
      return true;
    } else if (!autoPlay.value &&
        playbackState.value == PlaybackState.closed &&
        _source != null) {
      setAutoPlay(true);
      return true;
    }
  }
  return false;
}