I program with the spotify API.. the error are these 2 functions, I dont know how I call the 'setVolume' function in this arrow-function. Is this possible or is the Code wrong?
I don't know any further. Here is my code:
player.on('player_state_changed', state => {
//... SOME CODE ...
function setVolume(value) {
player.setVolume(value).then(() => {
console.log('Volume updated!');
});
}
});
(1) In the console I tried this:
setVolume(0.5)
(2) In the console I tried this:
player.on(setVolume(0.5))
~ and I got this error message: "player is not defined"
So how can I call the setVolume function from the console?