Bug 208442 - [GTK][WPE] Fix current time and duration formatting in media controls
Summary: [GTK][WPE] Fix current time and duration formatting in media controls
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-02 04:20 PST by Carlos Garcia Campos
Modified: 2020-03-03 07:28 PST (History)
9 users (show)

See Also:


Attachments
Patch (3.55 KB, patch)
2020-03-02 04:25 PST, Carlos Garcia Campos
calvaris: review+
calvaris: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2020-03-02 04:20:52 PST
We are always using mm:ss for current time and duration. We should use different amount of digits depending on the duration:

m:ss <- duration < 10 minutes
mm:ss <- duration < 1 hour
h:mm:ss <- duration < 10 hours
hh:mm:ss <- duration >= 10 hours
Comment 1 Carlos Garcia Campos 2020-03-02 04:25:47 PST
Created attachment 392128 [details]
Patch
Comment 2 Xabier Rodríguez Calvar 2020-03-02 07:24:27 PST
Comment on attachment 392128 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=392128&action=review

> Source/WebCore/Modules/mediacontrols/mediaControlsAdwaita.js:411
> +        else if (duration < 10 * 60) /* Ten minutes */
> +            this.timeDigitsCount = 3;

I personally dislike having this on a time display. I would strongly recommend you remove this or run it thru more people who can give an opinion on this.
Comment 3 Carlos Garcia Campos 2020-03-03 01:12:06 PST
(In reply to Xabier Rodríguez Calvar from comment #2)
> Comment on attachment 392128 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=392128&action=review
> 
> > Source/WebCore/Modules/mediacontrols/mediaControlsAdwaita.js:411
> > +        else if (duration < 10 * 60) /* Ten minutes */
> > +            this.timeDigitsCount = 3;
> 
> I personally dislike having this on a time display. I would strongly
> recommend you remove this or run it thru more people who can give an opinion
> on this.

What do you mean? You don't like m:ss and h:mm:ss?
Comment 4 Xabier Rodríguez Calvar 2020-03-03 03:48:07 PST
(In reply to Carlos Garcia Campos from comment #3)
> (In reply to Xabier Rodríguez Calvar from comment #2)
> > Comment on attachment 392128 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=392128&action=review
> > 
> > > Source/WebCore/Modules/mediacontrols/mediaControlsAdwaita.js:411
> > > +        else if (duration < 10 * 60) /* Ten minutes */
> > > +            this.timeDigitsCount = 3;
> > 
> > I personally dislike having this on a time display. I would strongly
> > recommend you remove this or run it thru more people who can give an opinion
> > on this.
> 
> What do you mean? You don't like m:ss and h:mm:ss?

I don't like m:ss but I don't mind h:mm:ss. That was the design choice and I don't see a reason why it should not be respected now as well.
Comment 5 Carlos Garcia Campos 2020-03-03 05:06:33 PST
(In reply to Xabier Rodríguez Calvar from comment #4)
> (In reply to Carlos Garcia Campos from comment #3)
> > (In reply to Xabier Rodríguez Calvar from comment #2)
> > > Comment on attachment 392128 [details]
> > > Patch
> > > 
> > > View in context:
> > > https://bugs.webkit.org/attachment.cgi?id=392128&action=review
> > > 
> > > > Source/WebCore/Modules/mediacontrols/mediaControlsAdwaita.js:411
> > > > +        else if (duration < 10 * 60) /* Ten minutes */
> > > > +            this.timeDigitsCount = 3;
> > > 
> > > I personally dislike having this on a time display. I would strongly
> > > recommend you remove this or run it thru more people who can give an opinion
> > > on this.
> > 
> > What do you mean? You don't like m:ss and h:mm:ss?
> 
> I don't like m:ss but I don't mind h:mm:ss. That was the design choice and I
> don't see a reason why it should not be respected now as well.

For consistency with other browsers, GNOME and some other popular video players.
Comment 6 Carlos Garcia Campos 2020-03-03 07:28:27 PST
Committed r257778: <https://trac.webkit.org/changeset/257778>