startPlayback

suspend fun startPlayback(artistId: String? = null, playlistId: String? = null, albumId: String? = null, showId: String? = null, offsetLocalTrackId: String? = null, offsetTrackId: String? = null, offsetEpisodeId: String? = null, offsetIndex: Int? = null, trackIdsToPlay: List<String>? = null, localTrackIdsToPlay: List<String>? = null, episodeIdsToPlay: List<String>? = null, deviceId: String? = null)(source)

Start or resume playback.

Note: You can only use one of the following: offsetIndex, offsetLocalTrackId, offsetTrackId, offsetEpisodeId

Specify nothing to play to simply resume playback

Requires the SpotifyScope.UserModifyPlaybackState scope

Api Reference

Parameters

artistId

Start playing an artist

playlistId

Start playing a playlist

albumId

Start playing an album

offsetLocalTrackId

Start playing at a local track in the given/current context

offsetTrackId

Start playing at a track in the given/current context

offsetEpisodeId

Start playing at an episode in the given/current context

offsetIndex

Indicates from where in the given/current context playback should start. Zero-based indexing.

localTrackIdsToPlay

A list of local track ids to play. Max 100 combined between localTrackIdsToPlay, trackIdsToPlay, and episodeIdsToPlay

trackIdsToPlay

A list of track ids to play. Max 100 combined between localTrackIdsToPlay, trackIdsToPlay, and episodeIdsToPlay

episodeIdsToPlay

A list of episode ids to play. Max 100 combined between localTrackIdsToPlay, trackIdsToPlay, and episodeIdsToPlay

deviceId

The device to play on

Throws

if more than one type of play type is specified or the offset is illegal.


suspend fun startPlayback(contextUri: ContextUri? = null, offsetIndex: Int? = null, offsetPlayableUri: PlayableUri? = null, playableUrisToPlay: List<PlayableUri>? = null, deviceId: String? = null)(source)

Start or resume playback.

Note: You can only use one of the following: offsetIndex, offsetPlayableUri

Specify nothing to play to simply resume playback

Requires the SpotifyScope.UserModifyPlaybackState scope

Api Reference

Parameters

contextUri

Start playing an album, artist, show, or playlist

playableUrisToPlay

PlayableUri (Track, Local track, or Episode URIs) uris to play. these are converted into URIs. Max 100

offsetIndex

Indicates from where in the given/current context playback should start. Only available when playableUrisToPlay is used.

offsetPlayableUri

Start playing at a track/local track/episode uri in the given/current context instead of index (offsetIndex)

deviceId

The device to play on

Throws

if more than one type of play type is specified or the offset is illegal.