One Logo Pool Ball
NowPlaying · IOS API REFERENCE

MediaDevice.Capability

struct · iOS 27.0+ · SDK 27.1

struct Capability

The control capabilities of a device. Use this to specify what control operations a device supports. The system uses this information to enable or disable device-specific controls in the interface.

Members (2)

static · iOS 27.0+

absoluteVolume

TypeScript
static absoluteVolume(currentLevel: number, onChange: ((arg0: number) => Promise<void>)): MediaDevice_Capability
Swift declaration
static func absoluteVolume(_ currentLevel: Float, onChange: @escaping @Sendable (Float) async throws -> Void) -> MediaDevice.Capability

Returns a capability that lets the device be set to a specific volume level. Use this when the device supports setting an absolute volume level in the range `0.0` to `1.0`, where `0` represents silence and `1.0` represents the maximum volume level. - Parameters: - currentLevel: The current volume level of the device, in the range `0.0` to `1.0`. The system uses this to display the device's current volume in the interface. - onChange: An async closure the system calls when the user requests a new volume level. The closure receives the requested new level in the range `0.0` to `1.0`.

static · iOS 27.0+

relativeVolume

TypeScript
static relativeVolume(onIncrement: (() => Promise<void>), onDecrement: (() => Promise<void>)): MediaDevice_Capability
Swift declaration
static func relativeVolume(onIncrement: @escaping @Sendable () async throws -> Void, onDecrement: @escaping @Sendable () async throws -> Void) -> MediaDevice.Capability

Returns a capability that lets the device increase or decrease its volume incrementally. Use this when the device supports stepwise volume changes but doesn't expose an absolute level. - Parameters: - onIncrement: An async closure the system calls to step the volume up by one increment. - onDecrement: An async closure the system calls to step the volume down by one increment.

Skipped declarations

No declarations were skipped in this snapshot.

All NowPlaying types →