CurrentlyPlayingObject

@Serializable
data class CurrentlyPlayingObject(val context: SpotifyContext? = null, val timestamp: Long, val progressMs: Int? = null, val isPlaying: Boolean, val item: Playable? = null, currentlyPlayingTypeString: String, val actions: PlaybackActions)(source)

Information about the currently playing track and context

Parameters

context

A Context Object. Can be null.

timestamp

Unix Millisecond Timestamp when data was fetched

progressMs

Progress into the currently playing track. Can be null.

isPlaying

If something is currently playing.

item

The currently playing track or episode. Can be null.

actions

Allows to update the user interface based on which playback actions are available within the current context

Constructors

Link copied to clipboard
constructor(context: SpotifyContext? = null, timestamp: Long, progressMs: Int? = null, isPlaying: Boolean, item: Playable? = null, currentlyPlayingTypeString: String, actions: PlaybackActions)

Properties

Link copied to clipboard
Link copied to clipboard
val context: SpotifyContext? = null
Link copied to clipboard

The object type of the currently playing item. Can be one of track, episode, ad or unknown.

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