---
title: MediaCommand
framework: nowplaying
role: symbol
role_heading: Structure
path: nowplaying/mediacommand
---

# MediaCommand

A command that describes a media control action for a Now Playing session.

## Declaration

```swift
struct MediaCommand
```

## Mentioned in

Publishing media sessions

## Overview

Overview Use static factory methods to create commands for your session: var commands: [MediaCommand] {[     .play { await self.play() },     .pause { await self.pause() },     .next { await self.nextTrack() }.enabled(self.hasNextTrack), ]}

## Topics

### Instance Methods

- [enabled(_:)](nowplaying/mediacommand/enabled(_:).md)

### Type Methods

- [changePlaybackRate(supported:_:)](nowplaying/mediacommand/changeplaybackrate(supported:_:).md)
- [changeRepeatMode(current:supported:_:)](nowplaying/mediacommand/changerepeatmode(current:supported:_:).md)
- [changeShuffleMode(current:supported:_:)](nowplaying/mediacommand/changeshufflemode(current:supported:_:).md)
- [feedback(title:shortTitle:status:_:)](nowplaying/mediacommand/feedback(title:shorttitle:status:_:).md)
- [next(_:)](nowplaying/mediacommand/next(_:).md)
- [pause(_:)](nowplaying/mediacommand/pause(_:).md)
- [play(_:)](nowplaying/mediacommand/play(_:).md)
- [previous(_:)](nowplaying/mediacommand/previous(_:).md)
- [seekBackward(beginAction:endAction:)](nowplaying/mediacommand/seekbackward(beginaction:endaction:).md)
- [seekForward(beginAction:endAction:)](nowplaying/mediacommand/seekforward(beginaction:endaction:).md)
- [seekToPosition(_:)](nowplaying/mediacommand/seektoposition(_:).md)
- [skipBackward(preferredIntervals:_:)](nowplaying/mediacommand/skipbackward(preferredintervals:_:).md)
- [skipForward(preferredIntervals:_:)](nowplaying/mediacommand/skipforward(preferredintervals:_:).md)
- [stop(_:)](nowplaying/mediacommand/stop(_:).md)
- [togglePlayPause(_:)](nowplaying/mediacommand/toggleplaypause(_:).md)

### Enumerations

- [MediaCommand.FeedbackStatus](nowplaying/mediacommand/feedbackstatus.md)
- [MediaCommand.RepeatMode](nowplaying/mediacommand/repeatmode.md)
- [MediaCommand.ShuffleMode](nowplaying/mediacommand/shufflemode.md)

## See Also

### Creating commands

- [enabled(_:)](nowplaying/mediacommand/enabled(_:).md)
