Skip to content

Instantly share code, notes, and snippets.

@seresk
Created April 12, 2021 20:20
Show Gist options
  • Save seresk/686ec9925fe82c14b8ae12314a0cb757 to your computer and use it in GitHub Desktop.
Save seresk/686ec9925fe82c14b8ae12314a0cb757 to your computer and use it in GitHub Desktop.
Transferring the playback to another device
private async _transferDevice(): Promise<void> {
const devicesResponse = await this.dataService.put<void>(
'https://api.spotify.com/v1/me/player',
JSON.stringify({device_ids: [this.deviceService.activeDevice.id]}),
{
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