vidhiya-saagar / spg2

πŸŒ• Suraj Prakash Granth - Rails 7 Admin Application.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 a SoundCloudEmbed 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

  1. Update the Katha table in the database schema:

    • Add isPlaylist boolean column to indicate whether a Katha is a playlist.
    • Add soundcloud_url column to store the SoundCloud playlist URL.
  2. Update the API to include the isPlaylist and soundcloud_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! ✨