previous method

Future<bool> previous()

Previous track - pauses other players when skipping

Implementation

Future<bool> previous() async {
  final currentPlayer = _state.selectedPlayer.isNotEmpty
      ? _state.selectedPlayer
      : null;

  // Pause other players before going to previous track
  await _pauseOtherPlayers(currentPlayer);

  final success = await _service.previous(currentPlayer);
  if (!success) {
    _updateState(
      _state.copyWith(errorMessage: 'Failed to skip to previous track'),
    );
  }
  return success;
}