Announcements

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

When to use spotify web playback sdk vs web api

When to use spotify web playback sdk vs web api

Hi, I'm developing a music events listing web app using nextjs, and supabase as backend. I'm trying to add functionality where if a user uses spotify (and they have a premium account) to authenticate with my app, they can stream music directly from the app.

 

I'm getting a bit confused on whether I should create a custom player using web playback sdk within a react component that renders with each event listing, or whether I should use the spotify web api.

 

The web playback sdk docs say something like use another client to start playback and then select the broswer as the device. I don't really want to do this, just play directly from the app. Any advice please?

 

Reply
7 Replies

Sadly, Spotify discontinued the ability to stream directly from your Android or iOS app.

Hi, my app is a web app using nextjs. I managed to figure it out, i initialised spotify player in a parent component, passed down the device id in props and then used web api in child component to send a request to play a track using the device id. Works pretty well now!

The App Remote SDK can be used with both Premium and Free users and has the same functionality. Now you are limiting the 'streaming' (that's actually also a remote) functionality only to Spotify Premium subscribers.

Hey strangecarr can you please share your code I’m trying to implement the web playable sdk as well using NextJs but I’m struggling 

Hi strangecarr, are you referring to the device id of the spotify client that has connected to your app or a device id that belongs to the web player instance you've created in your app? If it's the id of your web player instance, where do you get this from?

Hi, I found it much easier and better suited for my needs to use the spotify oEmbed API - see on the home page of this app:

https://www.swipeygo.co.uk/

 

(you have to scroll down.- there you can see some live events with spotify icons. if you click the icon a spotify embed appears for music previews).

 

you can also search for events in a location using the form, and then swipe through the events. some events have spotify functionality, as well as youtube previews.

 

I found the embed much easier to work with compared with the playback sdk - although I did get it working, I have some code so let me know if you would like me to share (I have to admit I can't quite remember the details of how I got it working!)

spotifyScreen.PNG

 Thanks, strangecarr, After reading your older post several times, I figured out how to implement it

Suggested posts