Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const getPlayBackState = (socket) => {
- setInterval(async () => {
- try {
- const result = await spotifyApi.getMyCurrentPlaybackState({})
- if (Object.keys(result.body).length > 0) {
- socket.emit("getPlayBackState", result.body)
- }
- } catch (error) {
- console.error("playbackstate error: " + error)
- }
- }, 2000)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement