Announcements

Help Wizard

Step 1

NEXT STEP

Trying to call player.nextTrack() many times

Trying to call player.nextTrack() many times

Plan

Premium

Country

UK

Device

Edge browser

Operating System

windows 10

 

My Question or Issue

I have been testing player.nextTrack() with the Webplayer SDK for a project. I have found if I was to call player.nextTrack() every time a new track starts playing, it does not skip that track or it will skip one track and continue playing. Why does it do this and what is stopping it from skipping every track?

 

Below is some code I was testing with:

 

 

 

useEffect(() => {
    if (skip) {
      skipCount++;
      console.log("next track called " + skipCount);
      if (skipCount <= 10) nextTrack();
    }

  }, [currentTrack.id]);

 

 

Reply
0 Replies

Suggested posts