---
title: "changeShuffleMode(current:supported:_:)"
framework: nowplaying
role: symbol
role_heading: Type Method
path: "nowplaying/mediacommand/changeshufflemode(current:supported:_:)"
---

# changeShuffleMode(current:supported:_:)

Creates a command that changes the shuffle mode for media playback.

## Declaration

```swift
static func changeShuffleMode(current: MediaCommand.ShuffleMode, supported: [MediaCommand.ShuffleMode]? = nil, _ action: @escaping (MediaCommand.ShuffleMode) async throws -> Void) -> MediaCommand
```

## Parameters

- `current`: The current shuffle mode.
- `supported`: The supported shuffle modes. Pass nil to support all modes.
- `action`: The closure the system calls to change the shuffle mode.

## See Also

### Changing playback modes

- [changePlaybackRate(supported:_:)](nowplaying/mediacommand/changeplaybackrate(supported:_:).md)
- [changeRepeatMode(current:supported:_:)](nowplaying/mediacommand/changerepeatmode(current:supported:_:).md)
- [MediaCommand.RepeatMode](nowplaying/mediacommand/repeatmode.md)
- [MediaCommand.ShuffleMode](nowplaying/mediacommand/shufflemode.md)
