---
title: "play(_:)"
framework: nowplaying
role: symbol
role_heading: Type Method
path: "nowplaying/mediacommand/play(_:)"
---

# play(_:)

Creates a command that starts media playback.

## Declaration

```swift
static func play(_ action: @escaping () async throws -> Void) -> MediaCommand
```

## Parameters

- `action`: The closure the system calls to start playback.

## See Also

### Controlling playback

- [pause(_:)](nowplaying/mediacommand/pause(_:).md)
- [stop(_:)](nowplaying/mediacommand/stop(_:).md)
- [togglePlayPause(_:)](nowplaying/mediacommand/toggleplaypause(_:).md)
