Change volume with spotify App API

2019-05-05 20:14发布

问题:

I was wondering if someone has succefully managed to change the volume with the spotify app API

I can without hassle change the playstate with player.playing = true; but player.volume=0.5 will not work. Must I add a observer for this?

回答1:

The documentation for the Player object does indeed say that you can set volume as a float from 0.0 to 1.0.

https://developer.spotify.com/technologies/apps/docs/beta/f19ff300f8.html

It's possible you're only allowed to change the volume if your app initiated the playback that's occurring.



标签: api spotify