I can't get the 'ready' event to be called. Anyone else is having this issue?
const onSpotifyLoaded = controller => {
controller.addListener('ready', () => {
console.log("Player is Ready")
})
}
window.SpotifyIFrameAPI.createController(playerEl.current, {uri: 'xxx'}, onSpotifyLoaded)
window.onSpotifyIframeApiReady = IFrameAPI => {
window.SpotifyIFrameAPI = IFrameAPI
}
It looks like the first test of that function fails:
onWindowMessages = (e: MessageEvent): void => {
if (e.source === this.iframeElement.contentWindow) {
if (e.data?.type === 'player_ready') {
this.onPlayerReady();
}
if (e.data?.type === 'playback_update') {
const playbackState = e.data?.payload;
this.onPlaybackUpdate(playbackState);
}
}
};
I'm getting an error in the console to using this API. It could be that I'm misunderstanding the documentation on this. Could Spotify respond?
Just to add I'm getting the message "Failed to load resource: the server responded with a status of 404 (Not Found)" when I place the following code into the file
```js
Hey there you, Yeah, you! 😁 Welcome - we're glad you joined the Spotify Community! While you here, let's have a fun game…