One Logo Pool Ball
NowPlaying · IOS API REFERENCE

MediaDevice

struct · iOS 27.0+ · SDK 27.1

struct MediaDevice

A device that plays media in a remote session. Use this type to represent playback devices in your remote sessions. The system displays device information including the name, type, and volume level in the Now Playing interface. For more information, see <doc:publishing-remote-media-sessions>

Members (5)

get · iOS 27.0+

capabilities

TypeScript
get capabilities(): Array<MediaDevice_Capability>
Swift declaration
let capabilities: [MediaDevice.Capability]

The control capabilities this device supports. Each value in the array describes one operation the device supports, built from a ``Capability``, such as ``Capability/absoluteVolume(_:onChange:)`` or ``Capability/relativeVolume(onIncrement:onDecrement:)``. Pass an empty array if the device exposes no controllable capabilities.

init · iOS 27.0+

init

TypeScript
static init(id: string, name: string, type: MediaDevice_DeviceType, capabilities: Array<MediaDevice_Capability>): MediaDevice
Swift declaration
init(id: String, name: String, type: MediaDevice.DeviceType, capabilities: [MediaDevice.Capability])

Creates a media device with the specified identifier, name, type, and capabilities. - Parameters: - id: A stable, unique identifier for the device. - name: The human-readable name the system displays for the device. - type: The kind of device that plays media. - capabilities: The capabilities the device supports. Each value in the array describes one operation the device supports, built from a ``Capability``, such as ``Capability/absoluteVolume(_:onChange:)`` or ``Capability/relativeVolume(onIncrement:onDecrement:)``. Pass an empty array if the device exposes no controllable capabilities. - Note: `id` should be a stable identifier for the device that works across sessions.

get · iOS 27.0+

id

TypeScript
get id(): string
Swift declaration
let id: String

The unique identifier for this device. Use a stable, locally unique identifier for this device, such as a serial number hardware address, or persistent device name. The identifier must be consistent across app launches for the same device.

get · iOS 27.0+

name

TypeScript
get name(): string
Swift declaration
let name: String

The human-readable name of the device. The system displays this name in the Now Playing interface. Use a descriptive name that helps people identify the device. The name must be non-empty and at most 250 characters. It must start with an alphanumeric character, end with an alphanumeric character or `.`, and otherwise contain only alphanumerics, whitespace, and the punctuation `' - , & # .`. Symbols outside this set — including emoji and SF Symbols — are not permitted.

get · iOS 27.0+

type

TypeScript
get type(): MediaDevice_DeviceType
Swift declaration
let type: MediaDevice.DeviceType

The type of device. The system uses the device type to display an appropriate icon in the interface.

Skipped declarations

No declarations were skipped in this snapshot.

All NowPlaying types →