gita / gita-frontend-v2

Frontend for BhagavadGita.io v2
https://bhagavadgita.io
MIT License
43 stars 53 forks source link

Audio player updates #214

Closed elmeister closed 1 year ago

elmeister commented 1 year ago
vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
bg-frontend βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Sep 6, 2023 11:05am
bhagavad-gita βœ… Ready (Inspect) Visit Preview Sep 6, 2023 11:05am
github-actions[bot] commented 1 year ago

Image description CodeRabbit

Walkthrough

The changes primarily revolve around enhancing the audio player's functionality, introducing a new PlaybackRateButton component, and improving URL handling. The updates ensure that the player modal opens when the audio=1 query parameter is present in the URL and include search parameters in generated URLs.

Changes

Files Summary
public/js/audioseeker.js Removed code related to audio player's time update and click event handling, along with several helper functions.
src/components/Headers/AudioPlayer/PlaybackRateButton.tsx,
src/components/Headers/AudioPlayer/functions.ts,
src/components/Headers/AudioPlayer/index.tsx
Introduced PlaybackRateButton component and updateQueryString function. Refactored playback control logic. Added track progress handling and search parameters update on player close.
src/components/Chapter/PageNavigator.tsx,
src/components/Chapter/functions.ts
Added useRouter hook and getSearchPostfix function. Updated getPrevPageHref and getNextPageHref functions to append search parameters to URLs.
src/components/Headers/PageHeader.tsx,
src/components/LinkWithLocale.tsx
Added useEffect hook to open player modal when audio=1 query parameter is present. Modified getUpdatedHref function to include query string in URL.

"In the land of code, where logic intertwines, 🌿πŸ–₯️
A rabbit hopped and tweaked some lines. πŸ‡πŸ’»
Audio flows, URLs glow, πŸŽ΅πŸ”—
With each commit, our app does grow! πŸš€πŸŒ±"


Uplevel your code reviews with CodeRabbit Pro ### CodeRabbit Pro If you like this project, please support us by purchasing the [Pro version](https://coderabbit.ai). The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, CodeRabbit Pro is free for open source projects.