JMPerez / spotify-web-api-js

A client-side JS wrapper for the Spotify Web API

Home Page:https://jmperezperez.com/spotify-web-api-js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spotify player object giving me a non existent player id

shaunwhyte opened this issue · comments

Describe the bug
A clear and concise description of what the bug is.

To Reproduce

spotify-web-api-js
this.player = new (window as any).Spotify.Player({
name: 'SpotiPod',
getOAuthToken: cb => { cb(this.spotifyAuth.getToken()); }
,
volume: 1
});

Once this connects and i get the player id using this

player._options.id

I get a different Id to if i call the end point https://api.spotify.com/v1/me/player/device
Id from player._options.id doesnt work eg when i play a song it says device cannot be found

Expected behavior
The real player id, the same as which is returned when i call the get devices call under my account (https://api.spotify.com/v1/me/player/devices)

Windows, Chrome
Version 89.0.4389.90 (Official Build) (64-bit)

@shaunwhyte the Spotify.Player object is not part of this library. The library only fetches information through the API and the is returned by the Player is out of scope.

You might want to fetch the list of devices through the API to control the playback using the device id.

i thought about fetching the device id but i use Spotify.Player.seek as well...

this one was on me, i had an old spotify js sdk