Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Gapless Playback #34

Open
johnnyshankman opened this issue Oct 30, 2024 · 6 comments
Open

Feature: Gapless Playback #34

johnnyshankman opened this issue Oct 30, 2024 · 6 comments

Comments

@johnnyshankman
Copy link
Owner

johnnyshankman commented Oct 30, 2024

This is the next feature I want to work on.

It's very difficult as right now the whole app is based around only having one HTML5 <audio> tag on the page. All components expect they can just find that audio tag, call play, and the rest of the app will follow. In a sense, the audio tag itself is a stateful thing being used as the source of truth for the rest of the UX.

@johnnyshankman
Copy link
Owner Author

johnnyshankman commented Nov 7, 2024

This is actually shockingly difficult to pull off as even the slightest delay in react/zustand state management causes an audible gap.

@johnnyshankman
Copy link
Owner Author

johnnyshankman commented Nov 10, 2024

Turns out this is actually quite the computer science problem to solve but luckily someone else very smart has solved it for me:

I'll look into refactoring my app to use this player instead of my raw HTML5 audio tag. Need to do extensive testing and ensure there all expected audio file types playback.

@johnnyshankman
Copy link
Owner Author

johnnyshankman commented Nov 12, 2024

oh big bummer, it breaks the mediasession API integration by default:

not willing to budge on that. gonna have to figure out a workaround.

@johnnyshankman
Copy link
Owner Author

johnnyshankman commented Nov 12, 2024

nice i figured out a workaround late last night 👍 only caveat is losing the ability to do seeking. that's fine. no one does that.

@johnnyshankman
Copy link
Owner Author

johnnyshankman commented Nov 18, 2024

Wow i'm so hyped it works perfect right now. Just had to make one small bugfix to gapless 5 so that I wouldn't lose my place and cause songs to pause when removing songs from the playlist that come AFTER the currently playing song.

@johnnyshankman
Copy link
Owner Author

Oh HELL yes figured out a workaround for the seek time display lfg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant