Announcements

Help Wizard

Step 1

NEXT STEP

start/resume playback is infinite loading

start/resume playback is infinite loading

*I'm not an english speaker, excuse me.

*I use node.js and spotify-web-api-node(module).

 

I initialize web player using web playback SDK, and play music in this player device.

but the moment I send a request using start/resume playback, it infinite loaded. 

what is the reason and how can i fix it? 

here is my code.

 

 

 

app.get('/',async(req,res, next)=>{
    const access_token =spotifyApi.getAccessToken();
    res.render('index',{access_token});
    next();
});

app.post('/', async(req, res, next) => {

    const devices = await spotifyApi.getMyDevices();
    const id = devices.body.devices[0].id; //추가하기
    console.log(id);
    await spotifyApi.transferMyPlayback([id],true);
    await spotifyApi.play({ device_id: id, uris: ['spotify:track:7tajvm3L4vnNsOyMBf3yq3'] })
    console.log(devices.body);
   
});

 

 

 

 

Reply
0 Replies

Suggested posts

Let's introduce ourselves!

Hey there you,   Yeah, you! 😁   Welcome - we're glad you joined the Spotify Community!   While you here, let's have a fun game and get…

ModeratorStaff / Moderator/ 4 years ago  in Social & Random