setSpeed method

bool setSpeed(
  1. double speed
)

Set playback speed of the player.

speed: The speed to set between 0.5 and 2.

Implementation

bool setSpeed(double speed) {
  if (!disposed) {
    if (speed < 0.5) {
      speed = 0.5;
    } else if (speed > 2) {
      speed = 2;
    }
    if (this.speed.value != speed) {
      this.speed.value = speed;
      if (id.value != null) {
        _setSpeed();
      }
      return true;
    }
  }
  return false;
}