(spotify) play and pause when controlling

This commit is contained in:
2020-07-22 22:39:24 +02:00
parent d5402fe154
commit cc6efc49dd
4 changed files with 41 additions and 3 deletions

View File

@@ -20,6 +20,20 @@ export const redirectToSpotifyConnect = () => {
}
export const playOnSpotify = async (token: string, deviceId: string) => {
// const response = await fetch(
// `https://api.spotify.com/v1/me/player/shuffle?device_id=${deviceId}&state=true`,
// {
// method: 'PUT',
// headers: {
// accept: 'application/json',
// 'content-type': 'application/json',
// authorization: `Bearer ${token}`
// }
// }
// )
// console.log(await response.json())
await fetch(
`https://api.spotify.com/v1/me/player/play?device_id=${deviceId}`,
{