I literally copied and pasted the Spotify example code and pasted this in my /public/index.html
file of my React + Electron project
...
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<script src="https://sdk.scdn.co/spotify-player.js"></script>
<script>
window.onSpotifyWebPlaybackSDKReady = () => {
const token = '<access token>';
const player = new Spotify.Player({
name: 'Web Playback SDK Quick Start Player',
getOAuthToken: cb => { cb(token); }
});
// Error handling
player.addListener('initialization_error', ({ message }) => { console.error(message); });
player.addListener('authentication_error', ({ message }) => { console.error(message); });
...
And I get this error:
Uncaught (in promise) EMEError: No supported keysystem was found. index.js:18
followed by a
Failed to initialize player