mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-26 16:15:51 +03:00
[GH-ISSUE #586] How to resume playback after pause_playback()? #349
Labels
No labels
api-bug
bug
dependencies
documentation
duplicate
enhancement
external-ide
headless-mode
implicit-grant-flow
invalid
missing-endpoint
pr-welcome
private-api
pull-request
question
spotipy3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotipy#349
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jainal09 on GitHub (Oct 15, 2020).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/586
I have the following code that pause the current song.
But how do i resume the song after pause_playback()
or already paused song.
@stephanebruckert commented on GitHub (Oct 15, 2020):
https://spotipy.readthedocs.io/en/2.16.0/#spotipy.client.Spotify.start_playback
@jainal09 commented on GitHub (Oct 15, 2020):
So when i tried the above code I got the following error
Player command failed: No active device found, reason: NO_ACTIVE_DEVICE@jainal09 commented on GitHub (Oct 15, 2020):
Okay its very odd when I do first
pause_playback()and then
start_playback()It runs fine!
But if i restart the flask app and directly try to call
start_playback()i get the same errorPlayer command failed: No active device found, reason: NO_ACTIVE_DEVICE@Peter-Schorn commented on GitHub (Oct 15, 2020):
@jainal09 I've found that devices can become inactive very quickly. Try accessing using the
Spotify.devicesmethod to get the user's available devices, and ensure that at least one is active. For testing purposes, trying doing this before each request to thestart_playback()andpause_playback()methods.@stephanebruckert commented on GitHub (Oct 19, 2020):
@jainal09 can you confirm whether you see any device using
Spotify.devices()before attemptingSpotify.start_playback()?@jainal09 commented on GitHub (Oct 21, 2020):
Yeh i solved the issue. What is interesting is @Peter-Schorn 's suggestion was right sometimes
Spotify.devices()would not show device even if my spotify app is open in background in Windows 10 in paused mode.@Peter-Schorn commented on GitHub (Oct 21, 2020):
The fact that a Spotify client is running doesn't necessarily mean it's considered an active device.