CurrentlyPlayingContext

@Serializable
data class CurrentlyPlayingContext(val timestamp: Long, val device: Device, val progressMs: Int? = null, val isPlaying: Boolean, val item: Playable? = null, val shuffleState: Boolean, val repeatStateString: String, val context: SpotifyContext? = null)(source)

Information about the current playback

Parameters

timestamp

Unix Millisecond Timestamp when data was fetched

device

The device that is currently active

progressMs

Progress into the currently playing track. Can be null (e.g. If private session is enabled this will be null).

isPlaying

If something is currently playing.

item

The currently playing item (track or episode). Can be null (e.g. If private session is enabled this will be null).

context

A Context Object. Can be null (e.g. If private session is enabled this will be null). Note: this will likely be null when playing the first track in a playlist or show context.

shuffleState

If shuffle is on or off

Constructors

Link copied to clipboard
constructor(timestamp: Long, device: Device, progressMs: Int? = null, isPlaying: Boolean, item: Playable? = null, shuffleState: Boolean, repeatStateString: String, context: SpotifyContext? = null)

Properties

Link copied to clipboard
val context: SpotifyContext? = null
Link copied to clipboard
Link copied to clipboard
@SerialName(value = "is_playing")
val isPlaying: Boolean
Link copied to clipboard
@Serializable(with = PlayableSerializer::class)
@SerialName(value = "item")
val item: Playable? = null
Link copied to clipboard
@SerialName(value = "progress_ms")
val progressMs: Int? = null
Link copied to clipboard

If and how the playback is repeating

Link copied to clipboard
@SerialName(value = "repeat_state")
val repeatStateString: String
Link copied to clipboard
@SerialName(value = "shuffle_state")
val shuffleState: Boolean
Link copied to clipboard