Skip to content

Commit

Permalink
Communicate seeking state to controls.
Browse files Browse the repository at this point in the history
Regression from fcbb725. Other elements rely on controls
knowing current seek state. Now that seek bar is its own
class, it needs to update controls on that.

Change-Id: I29ae8faa9f830ef86380d6b07373dedbeebce263
  • Loading branch information
ismena committed Jul 22, 2019
1 parent a8aec97 commit 7c271ba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions ui/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,15 @@ shaka.ui.Controls = class extends shaka.util.FakeEventTarget {
return this.isSeeking_;
}


/**
* @param {boolean} seeking
* @export
*/
setSeeking(seeking) {
this.isSeeking_ = seeking;
}

/**
* @return {boolean}
* @export
Expand Down
3 changes: 2 additions & 1 deletion ui/seek_bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ shaka.ui.SeekBar = class extends shaka.ui.RangeElement {
* @override
*/
onChangeStart() {
this.controls.setSeeking(true);
this.video.pause();
}

Expand Down Expand Up @@ -126,7 +127,7 @@ shaka.ui.SeekBar = class extends shaka.ui.RangeElement {
// They just let go of the seek bar, so cancel the timer and manually
// call the event so that we can respond immediately.
this.seekTimer_.tickNow();

this.controls.setSeeking(false);
this.video.play();
}

Expand Down

0 comments on commit 7c271ba

Please sign in to comment.