Add Support for SoundCloud Playlists - SurajPodcast Launch
dsomel21 opened this issue Β· comments
π’ Adding Support for SoundCloud
π Description
The Suraj podcast is launching! The goal is to leverage existing social media platforms to engage with a broader audience. To that end, we aim to embed SoundCloud playlists directly into our application, as opposed to using direct mp3 links which were previously embedded with react-jinke-music-player.
π― Goal
Our Katha
and ChapterKatha
represent a single audio file for each chapter. We would like to extend this to include SoundCloud playlists. This will involve the following steps:
- Modifying the
Katha
table to accommodate SoundCloud playlists. - Updating our JSON to reflect these changes.
- Update the client-side application, Shaheedi SPG, to detect whether a
Katha
is a playlist. If it is, the application will render aSoundCloudEmbed
component with the appropriate SoundCloud URL.
This will be structured as follows:
{ katha.isPlaylist ?
<SoundCloudEmbed url={katha.soundcloud_url} />
:
<KathaPlayer audioTracks={kathas} />
}
(This is what we have now: https://github.com/vidhiya-saagar/shaheedi-spg/blob/main/src/screens/ReadChapterScreen/ReadChapterScreen.js#L104)
π οΈ Expected Changes
-
Update the
Katha
table in the database schema:- Add
isPlaylist
boolean column to indicate whether aKatha
is a playlist. - Add
soundcloud_url
column to store the SoundCloud playlist URL.
- Add
-
Update the API to include the
isPlaylist
andsoundcloud_url
fields.
β DONE!
Then, we can update the Katha
and ChapterKatha
components in the Shaheedi SPG project but that's a DIFFERENT REPO! Don't worry about that. In there we will conditionally render the <SoundCloudEmbed />
or <KathaPlayer />
based on the isPlaylist
field.
Please ensure that you document your code changes and test them thoroughly to ensure smooth integration.
Happy coding! β¨