Player extension
- on
Methods
-
addToQueue(
String uriToAdd, {String? deviceId}) → Future< void> -
Available on SpotifyApi, provided by the Player extension
Adds the item with the givenuriToAddto the end of the user's playback queue. -
getAvailableDevices(
) → Future< List< Device> > -
Available on SpotifyApi, provided by the Player extension
Retrieves a list of available devices where playback can be controlled. -
getCurrentlyPlayingTrack(
) → Future< Track?> -
Available on SpotifyApi, provided by the Player extension
Gets the track currently playing on the user's active device. Returnsnullif nothing is playing or no device is active. -
getPlaybackState(
) → Future< PlaybackState?> -
Available on SpotifyApi, provided by the Player extension
Returns the current playback state of the user (device, progress, repeat mode, etc.) Returnsnullif nothing is currently playing or no active device. -
getQueue(
) → Future< List< Track> > -
Available on SpotifyApi, provided by the Player extension
Returns a list of tracks currently in the user's playback queue. The first track is the currently playing track (if present). -
getRecentlyPlayed(
{int? limit, String? after, String? before}) → Future< List< Track> > -
Available on SpotifyApi, provided by the Player extension
Returns the user's recently played tracks. You can specifylimit,after(timestamp in ms), orbeforeto paginate. -
refreshPlaybackState(
) → Future< void> -
Available on SpotifyApi, provided by the Player extension
Refreshes the current playback state of the user. -
seekToPosition(
Duration position, {String? deviceId}) → Future< void> -
Available on SpotifyApi, provided by the Player extension
Seeks to the givenpositionin the currently playing track. -
setRepeatMode(
String state, {String? deviceId}) → Future< void> -
Available on SpotifyApi, provided by the Player extension
Sets the repeat mode for playback. Validstatevalues are 'track', 'context', or 'off'. -
setShuffle(
bool shuffle, {String? deviceId}) → Future< void> -
Available on SpotifyApi, provided by the Player extension
Enables or disables shuffle mode for playback. -
setVolume(
int volumePercent, {String? deviceId}) → Future< void> -
Available on SpotifyApi, provided by the Player extension
Sets the playback volume tovolumePercent, which must be between 0 and 100. -
skipToNext(
{String? deviceId}) → Future< void> -
Available on SpotifyApi, provided by the Player extension
Skips to the next track in the user's queue. -
skipToPrevious(
{String? deviceId}) → Future< void> -
Available on SpotifyApi, provided by the Player extension
Skips to the previous track in the user's queue. -
startOrResumePlayback(
{String? deviceId}) → Future< void> -
Available on SpotifyApi, provided by the Player extension
Starts or resumes playback on the user's active device. Optionally targets a specificdeviceId. -
togglePlayback(
) → Future< void> -
Available on SpotifyApi, provided by the Player extension
Toggles playback: pauses if playing, resumes if paused. Does nothing if there's no active device or no track is currently playing. -
transferPlayback(
String deviceId, {bool play = true}) → Future< void> -
Available on SpotifyApi, provided by the Player extension
Transfers playback to a specific device. Ifplayis true, playback will start on the new device.