Skip to content

Instantly share code, notes, and snippets.

@seresk
Created April 12, 2021 20:04
Show Gist options
  • Save seresk/55160543a7d316483ee4f8352243bdc1 to your computer and use it in GitHub Desktop.
Save seresk/55160543a7d316483ee4f8352243bdc1 to your computer and use it in GitHub Desktop.
Setting the volume
private async _setVolume(volume: number): Promise<void> {
const devicesResponse = await this.dataService.put<void>(
'https://api.spotify.com/v1/me/player/volume?volume_percent=' + volume + '&device_id=' + this.deviceService.activeDevice.id,
null,
{
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${this.authorizationService.spotifyAccessToken}`
}
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment