pause method

Future<void> pause()

Pause playback (can be resumed)

Implementation

Future<void> pause() async {
  if (_sessionId == null) {
    throw Exception('No active session');
  }
  if (!_isPlaying) {
    LavalinkLogger.warning('Cannot pause: player not playing', tag: 'Player');
    return;
  }

  LavalinkLogger.info('Pausing playback', tag: 'Player');

  final update = PlayerUpdate(paused: true);
  await restClient.updatePlayer(_sessionId!, guildId, update);
  _isPaused = true;
  _isPlaying = false;
}