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

[Redesign][Feature Request] In player screen, show remaining song time instead of duration #664

Open
Ivanf1 opened this issue Apr 2, 2024 · 5 comments

Comments

@Ivanf1
Copy link

Ivanf1 commented Apr 2, 2024

Hello! Coming from the Music app on iOS, in the player screen, I'm used to see the remaining time of the song currently being played instead of the duration.

What I would like to propose is to add a toggle in the settings that would allow to choose between the current behavior (show the total duration) or show the remaining time.

If this is something that you think could be worth to add, I could start working on it.

@Chaphasilor
Copy link
Collaborator

Hey! Yeah that sounds absolutely doable, and very straight-forward to implement! Just subtract the current position from the total duration at the right spot in the control area, and add the setting. Let me know if you want to handle it yourself, otherwise I can do it to!

Do you think the "time remaining" behavior should be the default on iOS, or should the default stay the same? Do other music apps like Spotify or Youtube Music also show the remaining time on iOS, or just the default music app?

@Ivanf1
Copy link
Author

Ivanf1 commented Apr 4, 2024

Hi!
I can't answer about the behavior of Youtube Music because I don't have a subscription for that. In Spotify, for me, the default behavior on iOS is to show the remaining time. For Finamp, also in the dynamic island and on the lock screen it shows the remaining time, so I think that making it the default behavior on iOS would would make the experience more uniform.

A problem I found by simply subtracting the current position from the total duration is that the two times will not update in sync. This behavior is the same as Spotify, you can see it in the following video.

spotify.mp4

Apple Music (and the Music app in general) updates the times in sync, as can be seen in this video.

apple_music.mp4

For the two videos the same song has been used. Note that the "Apple Music behavior" is also the same with Finamp on the dynamic island and the lock screen.

I, personally, prefer the way Apple Music does it. One way I found to implement this is to round down the duration of the song. For example if the song has a duration of 230217139 microseconds by rounding it to 230000000 and then just doing the subtraction as you suggested the two times are updated in sync. This rounding would be performed just for the display of the times.

Another way I think we could solve this is keeping a state with the time passed and the time remaining. Each time, before rendering the two values, we check if the new time passed and the new time remaining both differ from their previous values. If they do we render the new values, if they don't we render the old values. This would basically skip the frames were the two values would not update in sync. I haven't tried this solution yet.

What do you think would be the best solution?

@Chaphasilor
Copy link
Collaborator

Interesting that the behavior really is different between the platforms. You can test out Youtube Music's behavior without a subscription, it just won't allow background playback and will have ads afaik.

But yes, setting the default value of the setting to true for iOS sounds like a good idea then.
And the rounding is also the best approach I think, since the values are rounded down to seconds anyway. Maybe make sure the values actually are rounded and not just truncated, to prevent glitches in edge cases :)

Oh and don't forget to add the minus/hypthen as a prefix in that case, like the other apps do!

@Ivanf1
Copy link
Author

Ivanf1 commented Apr 4, 2024

The default behavior on YouTube Music is to show the total duration and it does not seem to have an option to change it to the remaining time.

@Chaphasilor
Copy link
Collaborator

Okay, yeah that doesn't really surprise me. We can proceed as planned though 👌🏻

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

2 participants