Commit 02183cca authored by Mounir Lamouri's avatar Mounir Lamouri Committed by Commit Bot

Media Controls: disable double-tap to scrub in immersive mode.

It is to easy to accidentally trigger the scrubbing otherwise according
to the VR team.

Bug: 827569
Change-Id: I55236c36c4759e64eea8f3ae2a49de452f95fc45
Reviewed-on: https://chromium-review.googlesource.com/1071714
Commit-Queue: Mounir Lamouri <mlamouri@chromium.org>
Reviewed-by: default avatarBecca Hughes <beccahughes@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#562131}
Reviewed-on: https://chromium-review.googlesource.com/c/1076374Reviewed-by: default avatarTommy Steimel <steimel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611412}
parent cd9c59d7
...@@ -1607,6 +1607,15 @@ void MediaControlsImpl::HandleTouchEvent(Event* event) { ...@@ -1607,6 +1607,15 @@ void MediaControlsImpl::HandleTouchEvent(Event* event) {
!ContainsRelatedTarget(event)) { !ContainsRelatedTarget(event)) {
event->SetDefaultHandled(); event->SetDefaultHandled();
// In immersive mode we don't use double-tap features, so instead of
// waiting 300 ms for a potential second tap, we just immediately toggle
// controls visiblity.
if (GetDocument().GetSettings() &&
GetDocument().GetSettings()->GetImmersiveModeEnabled()) {
MaybeToggleControlsFromTap();
return;
}
if (tap_timer_.IsActive()) { if (tap_timer_.IsActive()) {
// Cancel the visibility toggle event. // Cancel the visibility toggle event.
tap_timer_.Stop(); tap_timer_.Stop();
......
<!DOCTYPe html>
<title>Test that double tap does not trigger seeking in immersive mode</title>
<script src='../../resources/testharness.js'></script>
<script src='../../resources/testharnessreport.js'></script>
<script src='../media-controls.js'></script>
<body></body>
<script>
async_test(t => {
enableImmersiveMode(t);
const video = document.createElement('video');
video.controls = true;
document.body.appendChild(video);
video.src = '../content/test.ogv';
video.play().then(t.step_func(() => {
// Double tap in the top right hand corner
const coordinates = coordinatesOutsideElement(video);
doubleTouchAtCoordinates(
coordinates[0] + 10, coordinates[1] + 10, undefined,
t.step_func_done());
}));
video.addEventListener('seeking', t.unreached_func());
video.addEventListener('seeked', t.unreached_func());
});
</script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment