One Logo Pool Ball
NowPlaying · IOS API REFERENCE

MediaPlaybackSnapshot

struct · iOS 27.0+ · SDK 27.1

struct MediaPlaybackSnapshot

A snapshot of playback state and timing for a Now Playing session. Use a snapshot to describe whether the session is playing, paused, or buffering, along with the current elapsed time and the timestamp at which that elapsed time was captured. The system uses the snapshot to extrapolate elapsed time between updates.

Members (1)

init · iOS 27.0+

init

TypeScript
static init(state: MediaPlaybackSnapshot_PlaybackState, defaultPlaybackRate?: number, elapsedTime?: (number) | null, timestamp?: (globalThis.Date) | null): MediaPlaybackSnapshot
Swift declaration
init(state: MediaPlaybackSnapshot.PlaybackState, defaultPlaybackRate: Float = 1.0, elapsedTime: TimeInterval? = nil, timestamp: Date? = nil)

Creates a playback snapshot with the specified state and timing. - Parameters: - state: The current playback state. - defaultPlaybackRate: The baseline rate the player returns to after temporary rate changes. Defaults to `1.0`. - elapsedTime: The current elapsed time, in seconds. - timestamp: The wall-clock time associated with `elapsedTime`, used to extrapolate the current position. - Precondition: When `state` is `.playing(let rate)`, `rate` must be finite and non-zero. - Precondition: `defaultPlaybackRate` must be finite and greater than `0`.

Skipped declarations

No declarations were skipped in this snapshot.

All NowPlaying types →