PlayerEndpoint class
Endpoint of the player
- Inheritance
-
- Object
- EndpointBase
- EndpointPaging
- PlayerEndpoint
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addToQueue(
String trackId) → Future< void> -
currentlyPlaying(
) → Future< PlaybackState> - Get the object currently being played on the user’s Spotify account.
-
devices(
) → Future< Iterable< Device> > - Get information about a user’s available devices.
-
next(
{String? deviceId, bool retrievePlaybackState = true}) → Future< PlaybackState?> -
Skips to next track in the user’s queue.
deviceId
is optional. If not provided, the user's currently active device is the target.retrievePlaybackState
is optional. If true, the current playback state will be retrieved. Defaults to true. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pause(
{String? deviceId, bool retrievePlaybackState = true}) → Future< PlaybackState?> -
Pause playback on the user's account.
deviceId
is optional. If not provided, the user's currently active device is the target.retrievePlaybackState
is optional. If true, the current playback state will be retrieved. Defaults to true. -
playbackState(
[Market? market]) → Future< PlaybackState> -
Returns the current playback state, including progress, track
and active device. Returns an empty
PlaybackState
object when no playback context has been started. -
player(
[String? market]) → Future< PlaybackState> -
Returns the current playback state, including progress, track
and active device. Returns an empty
PlaybackState
object when no playback context has been started. -
previous(
{String? deviceId, bool retrievePlaybackState = true}) → Future< PlaybackState?> -
Skips to previous track in the user’s queue.
deviceId
is optional. If not provided, the user's currently active device is the target.retrievePlaybackState
is optional. If true, the current playback state will be retrieved. Defaults to true. -
queue(
) → Future< Queue> -
repeat(
RepeatState state, {String? deviceId, bool retrievePlaybackState = true}) → Future< PlaybackState?> -
Set the repeat mode for the user’s playback.
state
is required. Options are: RepeatState.off, RepeatState.track, RepeatState.context.deviceId
is optional. If not provided, the user's currently active device is the target.retrievePlaybackState
is optional. If true, the current playback state will be retrieved. Defaults to true. -
resume(
{String? deviceId, bool retrievePlaybackState = true}) → Future< PlaybackState?> -
Resume current playback on the user's active device if not specifically
set with
deviceId
.retrievePlaybackState
is optional. Iftrue
, the currentPlaybackState
will be retrieved. Default's totrue
. -
seek(
int positionMs, {String? deviceId, bool retrievePlaybackState = true}) → Future< PlaybackState?> -
Seeks to the given position in the user’s currently playing track.
positionMs
is required. The position in milliseconds to seek to.deviceId
is optional. If not provided, the user's currently active device is the target.retrievePlaybackState
is optional. If true, the current playback state will be retrieved. Defaults to true. -
shuffle(
bool state, {String? deviceId, bool retrievePlaybackState = true}) → Future< PlaybackState?> - Toggle Shuffle For User's Playback.
-
startOrResume(
{String? deviceId, StartOrResumeOptions? options, bool retrievePlaybackState = true}) → Future< PlaybackState?> -
Start a new context or resume current playback on the user's active device.
deviceId
is optional. If not provided, the user's currently active device is the target.options
is optional. If not provided, playback will start from the context's current track.retrievePlaybackState
is optional. If true, the current playback state will be retrieved. Defaults to true. -
startWithContext(
String contextUri, {String? deviceId, Offset? offset, bool retrievePlaybackState = true}) → Future< PlaybackState?> -
Start a new playback context (album, playlist) with given a
contextUri
. and given optionaldeviceId
. If not provided, the user's currently active device is the target. Set Offset to start playback at a specific point.retrievePlaybackState
is optional. Iftrue
, the currentPlaybackState
will be retrieved. Default's totrue
. -
startWithTracks(
List< String> trackUris, {String? deviceId, int positionMs = 0, bool retrievePlaybackState = true}) → Future<PlaybackState?> -
Start a new playback context with given
trackUris
and with given optionaldeviceId
. If not provided, the user's currently active device is the target. Playback can also start atpositionMs
, which is set to0
by default.retrievePlaybackState
is optional. Iftrue
, the currentPlaybackState
will be retrieved. Default's totrue
. -
toString(
) → String -
A string representation of this object.
inherited
-
transfer(
String deviceId, [bool play = true, bool retrievePlaybackState = true]) → Future< PlaybackState?> -
Transfer playback to a new device and determine if
it should start
play
ing. Default istrue
. -
volume(
int volumePercent, {String? deviceId, bool retrievePlaybackState = true}) → Future< PlaybackState?> -
Set the volume for the user’s current playback device.
volumePercent
is required. The volume to set. Must be a value from0
to100
inclusive.deviceId
is optional. If not provided, the user's currently active device is the target.retrievePlaybackState
is optional. Iftrue
, the current playback state will be retrieved. Defaults totrue
.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited