Spotify4Unity icon indicating copy to clipboard operation
Spotify4Unity copied to clipboard

Error: player command failed no active device found

Open mseiringer opened this issue 3 years ago • 3 comments

Hi everyone! We are getting this error and don't know how to solve it. "player command failed no active device found" We are grateful for all your tips. THANKS!

mseiringer avatar Nov 10 '21 16:11 mseiringer

Hi everyone, We are getting the same error. Could some help us out please? Thank you in advance.

267industries avatar Dec 10 '21 18:12 267industries

Same problem here... Have you found a solution?

appsbymansa avatar Oct 06 '22 20:10 appsbymansa

I found that you can gather the devices before playing. It's a hack but just to get over to the next step. you gather the devices and then pass them into the request

               DeviceResponse devices = await client.Player.GetAvailableDevices();
                string s = $" Devices: {devices.Devices.Count}";
				for (int i = 0; i < devices.Devices.Count; i++)
				{
                    s += $"\n{devices.Devices[i].Name}";

				}
                Debug.Log(s);

                // Play track in context of the playlist
                PlayerResumePlaybackRequest request = new PlayerResumePlaybackRequest()
                {
                    ContextUri = _contextUri,
                    OffsetParam = new PlayerResumePlaybackRequest.Offset() { Uri = _track.Uri },
                    DeviceId = devices.Devices[0].Id
                };
                await client.Player.ResumePlayback(request);

Jwho303 avatar May 13 '23 10:05 Jwho303