setPlaybackSpeed method

Future<void> setPlaybackSpeed(
  1. double rate
)

Sets playback rate, clamped to 0.25–4.

Implementation

Future<void> setPlaybackSpeed(double rate) async {
  final clamped = rate.clamp(0.25, 4.0).toDouble();
  await _send(
    'setPlaybackSpeed',
    (backend, handle) => backend.setPlaybackSpeed(handle, clamped),
  );
  _setValue = _value.copyWith(playbackSpeed: clamped);
}