r/reactnative • • Apr 05 '20

Building an open-source Spotify clone

294 Upvotes

25 comments sorted by

12

u/PROLIMIT Apr 05 '20 edited Apr 05 '20

I don't mean to mislead you with the video – it cant output audio. Unfortunately, it only acts as remote control. Check the list of features in the github readme for what it can and cannot do.

2

u/kingshane Apr 05 '20

Does it keep in sync if I change the song from my computer or some other controller? If so how did you solve that problem, I couldn't find any sort of webhook in the spotify API? I built a mini-player, but had to result to a polling type solution, and I'm not crazy about it.

(I know I could check the source code/build it locally, but at this point in time I'll take any human connection I can get πŸ™ƒ)

1

u/PROLIMIT Apr 06 '20

Hey. Well I do some shenanigans to keep it in sync. If you go to the folder src/features/player/StickyPlayer.tsx you will find the code there.

It is doing the polling πŸ™‚ thing. I set it to every 5 or 10 seconds if I remember correctly.

I know, I'm not crazy about it too. But I'm not crazy about a lot of things I did in this app either. Due to limitations with what the APIs Spotify offers, the app might make a lot of API calls to show some basic data.

The reason I'm okay doing it that way is because this is just an open source app mainly to practice UI stuff. Its just for learning, I don't expect it to be used seriously.

If there is anything you'd like to know I'd be happy to answer 😊

1

u/code_buddha Apr 06 '20

Well do you have plans to complete it? I can help. I am an android developer as well as a react native developer.

1

u/PROLIMIT Apr 06 '20

For now, I'm personally going to work on the stuff in the README todo list + bug fixes. I'll probably be working very on and off. Anyone is welcome to do a pull request for those and any bug fixes/improvements. Besides that please let me know beforehand if you plan to work on a new feature :)

1

u/code_buddha Apr 06 '20

Hey i noticed we need the Spotify app too along with this app. I don't see the point.

1

u/PROLIMIT Apr 06 '20

Yeap. Unfortunately I wasn't able to find a way to output audio. I set out with this project to practice UI mainly and I knew from the start there would be some things that we can't replicate.

2

u/mohammedgqudah Apr 05 '20

You could still use the Ui with youtube-dl to play songs,

Not sure if thata legal but iv seen many bots on discord use it :)

5

u/idanlo Apr 05 '20

This is cool. You should try to use react-native-spotify library which lets you actually play music. I have a project that uses this library if you want an example - https://github.com/idanlo/react-native-spotify

3

u/PROLIMIT Apr 06 '20

Is that library based on the iOS and Android Spotify SDKs? I remember looking at those, but couldn't find any documentation about outputting audio. The SDK for android is literally called 'App Remote'. I would be happy if you can point me in the right direction as I was thinking about writing a wrapper around audio functionality.

3

u/idanlo Apr 06 '20

Yeah, the library is called rn-spotify-sdk, I can see it’s not maintained and not updated for RN 0.60, so I believe you can write a native wrapper and use most of the code from this library. For me this library worked great

2

u/PROLIMIT Apr 06 '20

Very interesting. I'll take a look soon. Thanks man.

4

u/[deleted] Apr 05 '20

You did a good job , well done !

1

u/PROLIMIT Apr 05 '20

Thank you :)

3

u/andyboythekid Apr 05 '20

this is so good!

1

u/PROLIMIT Apr 05 '20

Thank you :)

3

u/HowlingOblivion Apr 06 '20

are you perhaps Malaysian?

1

u/PROLIMIT Apr 06 '20

I work in Malaysia but I'm from Jordan

2

u/ademcan_net Apr 05 '20

Wow, that’s awesome! Well done!

2

u/trebuszek Apr 05 '20

Looks awesome! The navigation is really impressive.

1

u/alexandr1us Apr 06 '20

Stunning! Really see RNW future of web app development

1

u/vikrantnegi Apr 06 '20

Awesome job and thanks for sharing it.

0

u/[deleted] Apr 05 '20

[deleted]

4

u/PROLIMIT Apr 05 '20

Thank you. Your app is really beautiful too. I would love to play around with framer motion. It looks very fun!