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

# changeRepeatMode(current:supported:_:)

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

## Declaration

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

## Parameters

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

## See Also

### Changing playback modes

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