Playback, library, history, and playlist contract for Spotify apps.
More...
Inherits ABC.
|
| SpotifyState | current_state (self) |
| | Return the latest available playback state.
|
| |
|
None | play (self) |
| | Start or resume playback.
|
| |
|
None | pause (self) |
| | Pause playback.
|
| |
|
None | play_pause (self) |
| | Toggle playback.
|
| |
|
None | next_track (self) |
| | Skip to the next track.
|
| |
|
None | previous_track (self) |
| | Return to the previous track.
|
| |
| None | set_volume_percent (self, int volume_percent) |
| | Set playback volume from 0 through 100.
|
| |
| None | seek_to_position_ms (self, int position_ms) |
| | Seek within the current track.
|
| |
| None | transfer_playback (self, str device_id, *bool play=True) |
| | Transfer playback to a Spotify Connect device.
|
| |
| tuple[SpotifyLibraryTrack,...] | saved_tracks (self, *int limit=20) |
| | Return tracks saved in the user's library.
|
| |
| tuple[SpotifyLibraryTrack,...] | recently_played (self, *int limit=20) |
| | Return recently played tracks.
|
| |
| None | play_track (self, str track_uri) |
| | Begin playback of one Spotify track URI.
|
| |
| tuple[SpotifyPlaylist,...] | playlists (self, *int limit=20) |
| | Return the current user's playlists.
|
| |
| tuple[SpotifyLibraryTrack,...] | playlist_tracks (self, str playlist_id, *int limit=20) |
| | Return playable tracks from one playlist.
|
| |
Playback, library, history, and playlist contract for Spotify apps.
◆ current_state()
| SpotifyState spotify.spotify_controller_if.SpotifyControllerIf.current_state |
( |
|
self | ) |
|
Return the latest available playback state.
- Returns
- Latest Spotify playback state.
◆ play_track()
| None spotify.spotify_controller_if.SpotifyControllerIf.play_track |
( |
|
self, |
|
|
str |
track_uri |
|
) |
| |
Begin playback of one Spotify track URI.
- Parameters
-
| track_uri | Spotify URI identifying the track to play. |
◆ playlist_tracks()
| tuple[SpotifyLibraryTrack, ...] spotify.spotify_controller_if.SpotifyControllerIf.playlist_tracks |
( |
|
self, |
|
|
str |
playlist_id, |
|
|
*int |
limit = 20 |
|
) |
| |
Return playable tracks from one playlist.
Controllers without playlist browsing support may return an empty tuple.
- Parameters
-
| playlist_id | Spotify identifier of the playlist to inspect. |
| limit | Maximum number of playlist tracks to return. |
- Returns
- Playable Spotify tracks, or an empty tuple when unsupported.
◆ playlists()
| tuple[SpotifyPlaylist, ...] spotify.spotify_controller_if.SpotifyControllerIf.playlists |
( |
|
self, |
|
|
*int |
limit = 20 |
|
) |
| |
Return the current user's playlists.
Controllers without library browsing support may return an empty tuple.
- Parameters
-
| limit | Maximum number of playlists to return. |
- Returns
- Available Spotify playlists, or an empty tuple when unsupported.
◆ recently_played()
| tuple[SpotifyLibraryTrack, ...] spotify.spotify_controller_if.SpotifyControllerIf.recently_played |
( |
|
self, |
|
|
*int |
limit = 20 |
|
) |
| |
Return recently played tracks.
- Parameters
-
| limit | Maximum number of history entries to return. |
- Returns
- Recently played Spotify tracks.
◆ saved_tracks()
| tuple[SpotifyLibraryTrack, ...] spotify.spotify_controller_if.SpotifyControllerIf.saved_tracks |
( |
|
self, |
|
|
*int |
limit = 20 |
|
) |
| |
Return tracks saved in the user's library.
- Parameters
-
| limit | Maximum number of saved tracks to return. |
- Returns
- Saved Spotify library tracks.
◆ seek_to_position_ms()
| None spotify.spotify_controller_if.SpotifyControllerIf.seek_to_position_ms |
( |
|
self, |
|
|
int |
position_ms |
|
) |
| |
Seek within the current track.
- Parameters
-
| position_ms | Target playback position in milliseconds. |
◆ set_volume_percent()
| None spotify.spotify_controller_if.SpotifyControllerIf.set_volume_percent |
( |
|
self, |
|
|
int |
volume_percent |
|
) |
| |
Set playback volume from 0 through 100.
- Parameters
-
| volume_percent | Requested Spotify playback volume percentage. |
◆ transfer_playback()
| None spotify.spotify_controller_if.SpotifyControllerIf.transfer_playback |
( |
|
self, |
|
|
str |
device_id, |
|
|
*bool |
play = True |
|
) |
| |
Transfer playback to a Spotify Connect device.
- Parameters
-
| device_id | Spotify Connect device identifier that should receive playback. |
| play | Whether playback should begin immediately after transfer. |
The documentation for this class was generated from the following file:
- controllers/spotify/spotify_controller_if.py