Announcements

Help Wizard

Step 1

NEXT STEP

Addressing autoplay block for slow-loading files

Addressing autoplay block for slow-loading files

I'm writing an app that lets users play a selection of spotify tracks by clicking on certain links.  I'm using the obvious: a click handler that invokes controller.loadUri() followed by controller.play().   But if the track is slow to load, I get console errors:

   "PlaybackError: Cannot perform operation; no list was loaded."

The usual fix is to wait for some kind of load event before calling play.   But then play would be invoked outside the click event handler, which would mean that autoplay is blocked and I need to get another click from the user.

Is there a way for me to tell the controller to load and play the track (once loaded) as an atomic operation so I don't need to wait for the load?

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