jeffvli / feishin

A modern self-hosted music player.
https://feishin.vercel.app
GNU General Public License v3.0
2.12k stars 82 forks source link

[Web Player] Trying to play a track while it's already playing does not restart it #508

Closed iiPythonx closed 3 months ago

iiPythonx commented 5 months ago

Expected Behavior

If I double click on a track while it's already playing, I would expect the track to restart.

Current Behavior

As you can see, right now the progress bar does what it should (goes back to the beginning), but the audio does not restart, so the progress bar just snaps back to the current track progress after some time.

https://github.com/jeffvli/feishin/assets/35084023/3939c46e-0a21-42b3-a183-c05a370dcc63

Steps to Reproduce

  1. Switch from MPV to the web player

  2. Play any track from any album

  3. Go back to the album and double click on that same track

  4. Observe the progress bar stutter and the audio not restart

Possible Solution (Not obligatory)

Not sure, guessing the web player is just missing a method to set the time position to 0 when it's already started.

Context

I'm used to double clicking on a track to restart it (think Spotify or any other audio player, really).

Your Environment

kgarner7 commented 3 months ago

This is related to how double click is handled (see https://github.com/jeffvli/feishin/blob/46fdacad813760cb2fda7b34cd7f1761413ed17b/src/renderer/features/now-playing/components/play-queue.tsx#L92). MPV just sets the queue, but for web player there is no seek back. Basically, would need to do https://github.com/jeffvli/feishin/blob/46fdacad813760cb2fda7b34cd7f1761413ed17b/src/renderer/features/player/hooks/use-center-controls.ts#L593

kgarner7 commented 3 months ago

Resolved by https://github.com/jeffvli/feishin/commit/90d3fb219d8693993a5ec4f6ef5b55a74e68b49f