⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 183965 in webkit


Ignore:
Timestamp:
May 7, 2015, 5:45:00 PM (11 years ago)
Author:
dino@apple.com
Message:

[iOS] While scrubbing and holding down, video continues to play
https://bugs.webkit.org/show_bug.cgi?id=144776
<rdar://problem/20863757>

Reviewed by Simon Fraser.

When we are scrubbing a video, we should pause playback. As we
let go of the scrubber playback can resume (but only if it was
playing originally).

  • Modules/mediacontrols/mediaControlsiOS.js:

(ControllerIOS.prototype.createControls): Listen for touchstart on the scrubber.
(ControllerIOS.prototype.handleTimelineInput): Call the prototype, but pause if necessary.
(ControllerIOS.prototype.handleTimelineChange): Just moved this to be with the other timeline functions.
(ControllerIOS.prototype.handleTimelineTouchStart): Add the listeners for end and cancel. Remember that we are
potentially about to scrub.
(ControllerIOS.prototype.handleTimelineTouchEnd): Remove the listeners.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r183960 r183965  
     12015-05-07  Dean Jackson  <dino@apple.com>
     2
     3        [iOS] While scrubbing and holding down, video continues to play
     4        https://bugs.webkit.org/show_bug.cgi?id=144776
     5        <rdar://problem/20863757>
     6
     7        Reviewed by Simon Fraser.
     8
     9        When we are scrubbing a video, we should pause playback. As we
     10        let go of the scrubber playback can resume (but only if it was
     11        playing originally).
     12
     13        * Modules/mediacontrols/mediaControlsiOS.js:
     14        (ControllerIOS.prototype.createControls): Listen for touchstart on the scrubber.
     15        (ControllerIOS.prototype.handleTimelineInput): Call the prototype, but pause if necessary.
     16        (ControllerIOS.prototype.handleTimelineChange): Just moved this to be with the other timeline functions.
     17        (ControllerIOS.prototype.handleTimelineTouchStart): Add the listeners for end and cancel. Remember that we are
     18        potentially about to scrub.
     19        (ControllerIOS.prototype.handleTimelineTouchEnd): Remove the listeners.
     20
    1212015-05-07  Said Abou-Hallawa  <sabouhallawa@apple.com>
    222
  • trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js

    r183797 r183965  
    146146        this.listenFor(this.controls.optimizedFullscreenButton, 'touchend', this.handleOptimizedFullscreenTouchEnd);
    147147        this.listenFor(this.controls.optimizedFullscreenButton, 'touchcancel', this.handleOptimizedFullscreenTouchCancel);
     148        this.listenFor(this.controls.timeline, 'touchstart', this.handleTimelineTouchStart);
    148149        this.stopListeningFor(this.controls.playButton, 'click', this.handlePlayButtonClicked);
    149150
     
    304305    },
    305306
    306     handleTimelineChange: function(event) {
    307         Controller.prototype.handleTimelineChange.call(this);
    308         this.updateProgress();
    309     },
    310 
    311307    handlePlayButtonTouchStart: function() {
    312308        this.controls.playButton.classList.add('active');
     
    495491        this.controls.startPlaybackButton.classList.remove('active');
    496492        return true;
     493    },
     494
     495    handleTimelineInput: function(event) {
     496        if (this.potentiallyScrubbing)
     497            this.video.pause();
     498        Controller.prototype.handleTimelineInput.call(this, event);
     499    },
     500
     501    handleTimelineChange: function(event) {
     502        Controller.prototype.handleTimelineChange.call(this, event);
     503        this.updateProgress();
     504    },
     505
     506    handleTimelineTouchStart: function(event) {
     507        this.potentiallyScrubbing = true;
     508        this.wasPlayingWhenScrubbingStarted = !this.video.paused;
     509        this.listenFor(this.controls.timeline, 'touchend', this.handleTimelineTouchEnd);
     510        this.listenFor(this.controls.timeline, 'touchcancel', this.handleTimelineTouchEnd);
     511    },
     512
     513    handleTimelineTouchEnd: function(event) {
     514        this.stopListeningFor(this.controls.timeline, 'touchend', this.handleTimelineTouchEnd);
     515        this.stopListeningFor(this.controls.timeline, 'touchcancel', this.handleTimelineTouchEnd);
     516        this.potentiallyScrubbing = false;
     517        if (this.wasPlayingWhenScrubbingStarted && this.video.paused)
     518            this.video.play();
    497519    },
    498520
Note: See TracChangeset for help on using the changeset viewer.