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

fix: don't trim too much when speed < 1 with playtime-remaining #871

Merged
merged 2 commits into from
Mar 11, 2024

Conversation

christoph-heinrich
Copy link
Contributor

Speed < 1 can require more parts of the formatted time then when speed >= 1.
E.g. when a video is almost 1min long and the speed is reduced to <1 then the minutes part of the remaining time would still get trimmed, even though it's not 00:.

Alternatively the max seconds could also be

local max_seconds = math.max(state.duration, (state.duration - state.time) / speed)

so that the time only gets longer when the remaining time is large enough to require less trimming.

Really not sure what the best way of handling this is...

@tomasklaen
Copy link
Owner

I'd be fine with this. But shouldn't the elapsed time be handled the same way? So that its length format always matches the destination.

@christoph-heinrich christoph-heinrich marked this pull request as ready for review March 10, 2024 14:41
@hooke007
Copy link
Contributor

hooke007 commented Mar 11, 2024

But shouldn't the elapsed time be handled the same way

Where we display this data? theoretically, it's the duration we had played. So it shouldn't be scaled with speed.
If users would like to seek to the position in the past, it would make confusion.

@christoph-heinrich
Copy link
Contributor Author

Where we display this data? theoretically, it's the duration we had played. So it shouldn't be scaled with speed.

It's not about scaling the elapsed time with speed, but about showing the same number of digits for elapsed time and destination/remaining time.

@hooke007
Copy link
Contributor

Got it.

@tomasklaen tomasklaen merged commit db985f1 into tomasklaen:main Mar 11, 2024
@christoph-heinrich christoph-heinrich deleted the remaining_time_speed branch March 11, 2024 11:46
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

Successfully merging this pull request may close these issues.

3 participants