Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Issue 297783004: Implement heuristic for showing media controls during playback w/o a mouse (Closed)

Created:
6 years, 7 months ago by fs
Modified:
6 years, 7 months ago
CC:
blink-reviews, blink-reviews-html_chromium.org, gasubic, eric.carlson_apple.com, feature-media-reviews_chromium.org, dglazkov+blink, nessy, vcarbune.chromium
Visibility:
Public.

Description

Implement heuristic for showing media controls during playback w/o a mouse This implements a heuristic that allows the media controls to re-appear when playback has started and the mouse is unavailable. The behavior is triggered by a 'focusin' event on the HTMLMediaElement, which shows the controls. The controls then remain visible as long as the media element itself or any part of the control retains focus, or until the hide timer fires (which it will on a pause-play "cycle" for instance). BUG=135661 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=174794

Patch Set 1 #

Total comments: 4

Patch Set 2 : Rebase; Remove shouldShowMediaControls; Add simple test. #

Total comments: 13

Patch Set 3 : Add test to see where the focus moves. #

Patch Set 4 : Fix brace-style in tests; Clarify comment. #

Patch Set 5 : Fix mousemove fade-out behavior. #

Patch Set 6 : Rebase. #

Patch Set 7 : IgnoreSelfHover -> IgnoreVideoHover; Tweak comment. #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+197 lines, -6 lines) Patch
A LayoutTests/media/video-controls-focus-movement-on-hide.html View 1 2 3 1 chunk +39 lines, -0 lines 1 comment Download
A LayoutTests/media/video-controls-focus-movement-on-hide-expected.txt View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
A LayoutTests/media/video-controls-hide-on-move-outside-controls.html View 1 2 3 4 1 chunk +55 lines, -0 lines 1 comment Download
A LayoutTests/media/video-controls-hide-on-move-outside-controls-expected.txt View 1 2 3 4 1 chunk +10 lines, -0 lines 0 comments Download
A LayoutTests/media/video-controls-show-on-focus.html View 1 2 3 1 chunk +35 lines, -0 lines 1 comment Download
A LayoutTests/media/video-controls-show-on-focus-expected.txt View 1 2 3 4 1 chunk +7 lines, -0 lines 0 comments Download
M Source/core/html/HTMLMediaElement.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/html/HTMLMediaElement.cpp View 1 1 chunk +9 lines, -0 lines 0 comments Download
M Source/core/html/shadow/MediaControls.h View 1 2 3 4 5 6 2 chunks +8 lines, -1 line 0 comments Download
M Source/core/html/shadow/MediaControls.cpp View 1 2 3 4 5 6 5 chunks +24 lines, -5 lines 0 comments Download

Messages

Total messages: 20 (0 generated)
acolwell GONE FROM CHROMIUM
https://codereview.chromium.org/297783004/diff/1/Source/core/html/shadow/MediaControls.cpp File Source/core/html/shadow/MediaControls.cpp (right): https://codereview.chromium.org/297783004/diff/1/Source/core/html/shadow/MediaControls.cpp#newcode196 Source/core/html/shadow/MediaControls.cpp:196: show(); Should we have a stopHideMediaControlsTimer() call here? https://codereview.chromium.org/297783004/diff/1/Source/core/html/shadow/MediaControls.cpp#newcode247 ...
6 years, 7 months ago (2014-05-22 00:31:16 UTC) #1
fs
https://codereview.chromium.org/297783004/diff/1/Source/core/html/shadow/MediaControls.cpp File Source/core/html/shadow/MediaControls.cpp (right): https://codereview.chromium.org/297783004/diff/1/Source/core/html/shadow/MediaControls.cpp#newcode196 Source/core/html/shadow/MediaControls.cpp:196: show(); On 2014/05/22 00:31:17, acolwell wrote: > Should we ...
6 years, 7 months ago (2014-05-22 15:48:44 UTC) #2
acolwell GONE FROM CHROMIUM
looks good. Just have a few questions. https://codereview.chromium.org/297783004/diff/20001/Source/core/html/shadow/MediaControls.cpp File Source/core/html/shadow/MediaControls.cpp (right): https://codereview.chromium.org/297783004/diff/20001/Source/core/html/shadow/MediaControls.cpp#newcode389 Source/core/html/shadow/MediaControls.cpp:389: if (!shouldHideMediaControls(IgnoreFocus)) ...
6 years, 7 months ago (2014-05-22 18:44:09 UTC) #3
fs
https://codereview.chromium.org/297783004/diff/20001/Source/core/html/shadow/MediaControls.cpp File Source/core/html/shadow/MediaControls.cpp (right): https://codereview.chromium.org/297783004/diff/20001/Source/core/html/shadow/MediaControls.cpp#newcode389 Source/core/html/shadow/MediaControls.cpp:389: if (!shouldHideMediaControls(IgnoreFocus)) On 2014/05/22 18:44:09, acolwell wrote: > What ...
6 years, 7 months ago (2014-05-23 07:05:40 UTC) #4
philipj_slow
On 2014/05/23 07:05:40, fs wrote: > https://codereview.chromium.org/297783004/diff/20001/Source/core/html/shadow/MediaControls.cpp > File Source/core/html/shadow/MediaControls.cpp (right): > > https://codereview.chromium.org/297783004/diff/20001/Source/core/html/shadow/MediaControls.cpp#newcode389 > ...
6 years, 7 months ago (2014-05-23 11:28:41 UTC) #5
fs
On 2014/05/23 11:28:41, philipj wrote: > On 2014/05/23 07:05:40, fs wrote: > > > https://codereview.chromium.org/297783004/diff/20001/Source/core/html/shadow/MediaControls.cpp ...
6 years, 7 months ago (2014-05-23 11:58:49 UTC) #6
philipj_slow
Maybe a test for where the tab focus ends up when the controls fade out ...
6 years, 7 months ago (2014-05-23 13:05:34 UTC) #7
philipj_slow
LGTM % comments and maybe that test I mentioned https://codereview.chromium.org/297783004/diff/20001/LayoutTests/media/video-controls-show-on-focus.html File LayoutTests/media/video-controls-show-on-focus.html (right): https://codereview.chromium.org/297783004/diff/20001/LayoutTests/media/video-controls-show-on-focus.html#newcode15 LayoutTests/media/video-controls-show-on-focus.html:15: ...
6 years, 7 months ago (2014-05-23 13:22:42 UTC) #8
fs
On 2014/05/23 13:05:34, philipj wrote: > Maybe a test for where the tab focus ends ...
6 years, 7 months ago (2014-05-23 14:17:21 UTC) #9
fs
https://codereview.chromium.org/297783004/diff/20001/LayoutTests/media/video-controls-show-on-focus.html File LayoutTests/media/video-controls-show-on-focus.html (right): https://codereview.chromium.org/297783004/diff/20001/LayoutTests/media/video-controls-show-on-focus.html#newcode15 LayoutTests/media/video-controls-show-on-focus.html:15: document.querySelector("video").addEventListener("timeupdate", function(event) { On 2014/05/23 13:22:43, philipj wrote: > ...
6 years, 7 months ago (2014-05-23 14:39:29 UTC) #10
fs
On 2014/05/23 14:39:29, fs wrote: > https://codereview.chromium.org/297783004/diff/20001/Source/core/html/shadow/MediaControls.cpp#newcode222 > Source/core/html/shadow/MediaControls.cpp:222: if (m_panel->hovered() || > m_isMouseOverControls) > ...
6 years, 7 months ago (2014-05-23 15:36:37 UTC) #11
acolwell GONE FROM CHROMIUM
https://codereview.chromium.org/297783004/diff/120001/LayoutTests/media/video-controls-focus-movement-on-hide.html File LayoutTests/media/video-controls-focus-movement-on-hide.html (right): https://codereview.chromium.org/297783004/diff/120001/LayoutTests/media/video-controls-focus-movement-on-hide.html#newcode28 LayoutTests/media/video-controls-focus-movement-on-hide.html:28: if (video.currentTime < 4) nit: I think we should ...
6 years, 7 months ago (2014-05-23 18:26:28 UTC) #12
philipj_slow
https://codereview.chromium.org/297783004/diff/20001/Source/core/html/shadow/MediaControls.cpp File Source/core/html/shadow/MediaControls.cpp (right): https://codereview.chromium.org/297783004/diff/20001/Source/core/html/shadow/MediaControls.cpp#newcode225 Source/core/html/shadow/MediaControls.cpp:225: // controls/shadow tree. (Perform the checks separately to avoid ...
6 years, 7 months ago (2014-05-23 20:08:33 UTC) #13
philipj_slow
PS7 LGTM, leaving the final say to acolwell.
6 years, 7 months ago (2014-05-23 20:31:03 UTC) #14
acolwell GONE FROM CHROMIUM
On 2014/05/23 20:31:03, philipj wrote: > PS7 LGTM, leaving the final say to acolwell. I'm ...
6 years, 7 months ago (2014-05-24 01:12:42 UTC) #15
fs
On 2014/05/24 01:12:42, acolwell_OOO_5-24_to_5-30 wrote: > On 2014/05/23 20:31:03, philipj wrote: > > PS7 LGTM, ...
6 years, 7 months ago (2014-05-26 07:34:17 UTC) #16
fs
The CQ bit was checked by fs@opera.com
6 years, 7 months ago (2014-05-26 07:34:35 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fs@opera.com/297783004/120001
6 years, 7 months ago (2014-05-26 07:34:48 UTC) #18
commit-bot: I haz the power
Change committed as 174794
6 years, 7 months ago (2014-05-26 09:03:59 UTC) #19
fs
6 years, 7 months ago (2014-05-26 13:22:03 UTC) #20
Message was sent while issue was closed.
On 2014/05/23 18:26:28, acolwell_OOO_5-24_to_5-30 wrote:
>
https://codereview.chromium.org/297783004/diff/120001/LayoutTests/media/video...
> File LayoutTests/media/video-controls-focus-movement-on-hide.html (right):
> 
>
https://codereview.chromium.org/297783004/diff/120001/LayoutTests/media/video...
> LayoutTests/media/video-controls-focus-movement-on-hide.html:28: if
> (video.currentTime < 4)
> nit: I think we should define a constant in media-controls.js to indicate that
> this is enough time for the controls to auto-hide. I think that will make it
> easier to fix broken tests if this value ever changes.
> 
>
https://codereview.chromium.org/297783004/diff/120001/LayoutTests/media/video...
> File LayoutTests/media/video-controls-hide-on-move-outside-controls.html
> (right):
> 
>
https://codereview.chromium.org/297783004/diff/120001/LayoutTests/media/video...
> LayoutTests/media/video-controls-hide-on-move-outside-controls.html:20: if
> (video.currentTime < 4)
> ditto. Actually, I wonder if we should put this functionality in some sort of
> helper function and make it setTimeout() based since technically the fade out
> isn't dependent on elapsed playback time. We just have to make sure that we
are
> playing. 
> 
> I realize now that the test I added set a bad example to follow. :)
> 
>
https://codereview.chromium.org/297783004/diff/120001/LayoutTests/media/video...
> File LayoutTests/media/video-controls-show-on-focus.html (right):
> 
>
https://codereview.chromium.org/297783004/diff/120001/LayoutTests/media/video...
> LayoutTests/media/video-controls-show-on-focus.html:13: var fadeinTime = 300;
> I think we should make this a constant in media-controls.js too.

https://codereview.chromium.org/302603003/

Powered by Google App Engine
This is Rietveld 408576698