SKPlaybackState

public struct SKPlaybackState : JSONDecodable

An aggregated collection of values defining the current state of a Spotify player.

See also

The Web API Currently Playing object.
  • The device that is currently active.

    Declaration

    Swift

    public let device: SKDevice?
  • The current repeat mode. See SKRepeatMode for possible values.

    Declaration

    Swift

    public let repeatMode: SKRepeatMode?
  • A Boolean value indicating whether shuffling is turned on.

    Declaration

    Swift

    public let isShuffling: Bool?
  • The context in which the current track is played, such as an album, artist, or playlist.

    If no track is currently playing, this property will be nil.

    Declaration

    Swift

    public let context: SKPlaybackContext?
  • The date and time that this data was fetched, with millisecond precision.

    You can use this date in conjuntion with the progress property to determine the currently elapsed playback time of the current track, if one is playing.

    Declaration

    Swift

    public var timestamp: Date { get }
  • The progress into the currently playing track in seconds, with millisecond precision.

    If no track is currently playing, this property will be nil.

    Declaration

    Swift

    public var progress: TimeInterval? { get }
  • A Boolean value indicating whether a track is currently playing.

    Declaration

    Swift

    public let isPlaying: Bool
  • The currently playing track.

    If no track is currently playing, this property will be nil.

    Declaration

    Swift

    public let track: SKTrack?