Play music on mobile - Spotify Complete plugin

Hello to all the Bubblers,

I’m posting a new topic on the forum because after a lot of research I still haven’t found any solution to my problem.

In fact, I’m trying to allow users of my app to add a music to a photo they would post. To do this, users must first log in to their Spotify account.

Then, when creating a post, they can select a photo and then select a music.

Then, when they click on the music of their choice, I’d like it to play directly on the user’s phone so they can view their entire post.

Finally, when users click on the published posts, the photo will be displayed with the music automatically playing at the same time.

To do this I used the great Plugin made by Ottho which allowed me to create the login/signup with Spotify and also to create a music search by connecting directly to the Spotify api.

Also the only problem that persists is that I can’t get the music to play on the user’s phone.

According to my research, in order to launch the music, you have to give Spotify a device ID. The problem is that the plugin does find the user’s device IDs, but only those that are currently active and not the others.

Here is the workflow currently in place

I also found a “transfer user’s playback” function but it’s not in the workflow and I don’t see how to make it work…

After more than a week of research I rely on you to help me find a solution to this problem.

Thanks in advance to those who will take the time to answer me and have a nice day !

Arh, I wish it was that simple @maxime.nivot
Unfortunately, you can’t tell the user’s phone to start playing the music just through an API call.
I don’t know the exact details of this specific feature but there are some limitations which I think are:

  • The device must be already playing in order to use that API call to prevent abuse
  • It only works on specific devices (can’t tell which ones though - maybe just SONOS-like devices)

And generally speaking, I think the way you’re trying to achieve it is not the right direction to take. Force launching the Spotify app on the user’s phone to play the song seems really intrusive (let’s say maybe I’m already listening on my SONOS system or something else and can launch on another phone if I logged in elsewhere) and will override all the user’s phone default settings (such as volume level, …)

I think what you’re looking for is an embedded player or the Spotify SDK, which might be tricky to integrate on Bubble:

By the way, really nice app design-wise :slight_smile: