Bug 165492 - [Modern Media Controls] Automatically hide the controls bar when the mouse is idle
Summary: [Modern Media Controls] Automatically hide the controls bar when the mouse is...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antoine Quint
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-06 14:32 PST by Antoine Quint
Modified: 2016-12-06 15:40 PST (History)
0 users

See Also:


Attachments
Patch (36.97 KB, patch)
2016-12-06 14:41 PST, Antoine Quint
dino: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Quint 2016-12-06 14:32:51 PST
[Modern Media Controls] Automatically hide the controls bar when the mouse is idle
Comment 1 Antoine Quint 2016-12-06 14:41:33 PST
Created attachment 296324 [details]
Patch
Comment 2 Dean Jackson 2016-12-06 15:17:36 PST
Comment on attachment 296324 [details]
Patch

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

> Source/WebCore/ChangeLog:9
> +        visible for 4 seconds, regardless of where the mouse pointer is located. When the user mouves over the

typo moves or mouses, i'm not sure.

> Source/WebCore/ChangeLog:11
> +        moved his mouve over the media. When the user mouses out of the media, the controls automatically hide.

typo mouse

> Source/WebCore/ChangeLog:13
> +        When the mouse is over the controls bar, it remains visible. When the media is paused, the controls bar
> +        remain visible regardless of the mouse position.

Dan thinks this is not the correct experience. He thinks you should be able to click to hide the controls, so that you can take a screenshot. This is how Sochi worked.

> Source/WebCore/ChangeLog:22
> +        * Modules/modern-media-controls/controls/controls-bar.css: Copied from Source/WebCore/Modules/modern-media-controls/controls/controls-bar.js.

Next time I see this it is r-

> Source/WebCore/Modules/modern-media-controls/controls/controls-bar.js:39
> +        this.autoHideDelay = ControlsBar.DefaultAutoHideDelay;

It's annoying that your dataset attribute means that you need an instance of the delay on the object.

> Source/WebCore/Modules/modern-media-controls/controls/controls-bar.js:144
> +                this._rewindAutoHideTimer(true);

I think this should be _resetAutoHideTimer

> Source/WebCore/Modules/modern-media-controls/controls/controls-bar.js:182
> +    _rewindAutoHideTimer(cancelable)

Prefer _resetAutoHideTimer.

> LayoutTests/media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave.html:4
> +<video src="../../content/test.mp4" style="position: absolute; left: 0; top: 0; width: 320px; height: 240px;" controls autoplay data-auto-hide-delay="250"></video>

Can you make it 100?

> LayoutTests/media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave.html:25
> +        eventSender.mouseMoveTo(100, 100);

I'd really prefer UIScripts here, but I guess they don't work on macOS.

> LayoutTests/media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave.html:26
> +        window.requestAnimationFrame(() => {

Why rAF instead of a timer?
Comment 3 Antoine Quint 2016-12-06 15:33:53 PST
(In reply to comment #2)
> Comment on attachment 296324 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=296324&action=review
> 
> > Source/WebCore/ChangeLog:9
> > +        visible for 4 seconds, regardless of where the mouse pointer is located. When the user mouves over the
> 
> typo moves or mouses, i'm not sure.
> 
> > Source/WebCore/ChangeLog:11
> > +        moved his mouve over the media. When the user mouses out of the media, the controls automatically hide.
> 
> typo mouse
> 
> > Source/WebCore/ChangeLog:13
> > +        When the mouse is over the controls bar, it remains visible. When the media is paused, the controls bar
> > +        remain visible regardless of the mouse position.
> 
> Dan thinks this is not the correct experience. He thinks you should be able
> to click to hide the controls, so that you can take a screenshot. This is
> how Sochi worked.

Yes, I have it fixed in my branch, this is covered by a separate bug.

> > Source/WebCore/ChangeLog:22
> > +        * Modules/modern-media-controls/controls/controls-bar.css: Copied from Source/WebCore/Modules/modern-media-controls/controls/controls-bar.js.
> 
> Next time I see this it is r-

Oops.

> > Source/WebCore/Modules/modern-media-controls/controls/controls-bar.js:39
> > +        this.autoHideDelay = ControlsBar.DefaultAutoHideDelay;
> 
> It's annoying that your dataset attribute means that you need an instance of
> the delay on the object.

Yes, that's the best way I could think of modifying the timer from a test though.

> > Source/WebCore/Modules/modern-media-controls/controls/controls-bar.js:144
> > +                this._rewindAutoHideTimer(true);
> 
> I think this should be _resetAutoHideTimer
> 
> > Source/WebCore/Modules/modern-media-controls/controls/controls-bar.js:182
> > +    _rewindAutoHideTimer(cancelable)
> 
> Prefer _resetAutoHideTimer.

OK, will fix.

> > LayoutTests/media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave.html:4
> > +<video src="../../content/test.mp4" style="position: absolute; left: 0; top: 0; width: 320px; height: 240px;" controls autoplay data-auto-hide-delay="250"></video>
> 
> Can you make it 100?

I prefer to use 250, I worry that 100 would be too short and that we might face some timing-related issues.

> > LayoutTests/media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-enter-and-mouse-leave.html:26
> > +        window.requestAnimationFrame(() => {
> 
> Why rAF instead of a timer?

Because we want to wait for the media controls scheduler to perform its layout tasks on the next rAF.
Comment 4 Antoine Quint 2016-12-06 15:40:24 PST
https://trac.webkit.org/changeset/209430