[iOS] MediaControls: disappear while scrubbing
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 May 2015 01:55:08 +0000 (01:55 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 May 2015 01:55:08 +0000 (01:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=144777
<rdar://problem/20065572>

Reviewed by Eric Carlson.

If we are scrubbing we shouldn't hide the controls.

* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.hideControls): Return early if we are scrubbing.
* Modules/mediacontrols/mediaControlsiOS.js:
(ControllerIOS.prototype): Add initial value for _potentiallyScrubbing and
rename from non-underscored value throughout the file.
(ControllerIOS.prototype.handleTimelineTouchEnd): When we finish scrubbing, reset
the timer to hide the controls.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183971 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/Modules/mediacontrols/mediaControlsApple.js
Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js

index 5ded62f..4211ec7 100644 (file)
@@ -1,3 +1,21 @@
+2015-05-07  Dean Jackson  <dino@apple.com>
+
+        [iOS] MediaControls: disappear while scrubbing
+        https://bugs.webkit.org/show_bug.cgi?id=144777
+        <rdar://problem/20065572>
+
+        Reviewed by Eric Carlson.
+
+        If we are scrubbing we shouldn't hide the controls.
+
+        * Modules/mediacontrols/mediaControlsApple.js:
+        (Controller.prototype.hideControls): Return early if we are scrubbing.
+        * Modules/mediacontrols/mediaControlsiOS.js:
+        (ControllerIOS.prototype): Add initial value for _potentiallyScrubbing and
+        rename from non-underscored value throughout the file.
+        (ControllerIOS.prototype.handleTimelineTouchEnd): When we finish scrubbing, reset
+        the timer to hide the controls.
+
 2015-05-07  Simon Fraser  <simon.fraser@apple.com>
 
         REGRESSION (r183300): Fixed elements flash when scrolling
index 8740244..a75f240 100644 (file)
@@ -1362,7 +1362,7 @@ Controller.prototype = {
 
     hideControls: function()
     {
-        if (this.controlsAlwaysVisible())
+        if (this.controlsAlwaysVisible() || this._potentiallyScrubbing)
             return;
 
         this.updateShouldListenForPlaybackTargetAvailabilityEvent();
index 8c4c205..f876f0b 100644 (file)
@@ -16,6 +16,7 @@ function ControllerIOS(root, video, host)
 
     this._timelineIsHidden = false;
     this._currentDisplayWidth = 0;
+    this._potentiallyScrubbing = false;
     this.scheduleUpdateLayoutForDisplayedWidth();
 
     host.controlsDependOnPageScaleFactor = true;
@@ -493,7 +494,7 @@ ControllerIOS.prototype = {
     },
 
     handleTimelineInput: function(event) {
-        if (this.potentiallyScrubbing)
+        if (this._potentiallyScrubbing)
             this.video.pause();
         Controller.prototype.handleTimelineInput.call(this, event);
     },
@@ -504,7 +505,7 @@ ControllerIOS.prototype = {
     },
 
     handleTimelineTouchStart: function(event) {
-        this.potentiallyScrubbing = true;
+        this._potentiallyScrubbing = true;
         this.wasPlayingWhenScrubbingStarted = !this.video.paused;
         this.listenFor(this.controls.timeline, 'touchend', this.handleTimelineTouchEnd);
         this.listenFor(this.controls.timeline, 'touchcancel', this.handleTimelineTouchEnd);
@@ -513,9 +514,11 @@ ControllerIOS.prototype = {
     handleTimelineTouchEnd: function(event) {
         this.stopListeningFor(this.controls.timeline, 'touchend', this.handleTimelineTouchEnd);
         this.stopListeningFor(this.controls.timeline, 'touchcancel', this.handleTimelineTouchEnd);
-        this.potentiallyScrubbing = false;
-        if (this.wasPlayingWhenScrubbingStarted && this.video.paused)
+        this._potentiallyScrubbing = false;
+        if (this.wasPlayingWhenScrubbingStarted && this.video.paused) {
             this.video.play();
+            this.resetHideControlsTimer();
+        }
     },
 
     handleReadyStateChange: function(event) {