Skip to content

Commit

Permalink
Stop update images when livestream is paused
Browse files Browse the repository at this point in the history
Fixing: when a livestream is paused, we force the playhead back in
if the playhead falls out of the seek range, which makes the paused
image change.
Now we'll jump when the user hits play.

Closes #982.

Change-Id: I3f9e05e15c710488477b70ea7642f007c771ea92
  • Loading branch information
michellezhuogg committed Oct 19, 2017
1 parent 56740ad commit 0d5c357
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/media/playhead.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,13 @@ shaka.media.Playhead.prototype.onSeekingToStartTime_ = function() {
* @private
*/
shaka.media.Playhead.prototype.onPollGapJump_ = function() {
if (this.video_.readyState == 0 || this.video_.seeking)
return;
// Don't gap jump before the video is ready to play.
if (this.video_.readyState == 0) return;
// Don't gap jump while seeking, to prevent a race condition.
if (this.video_.seeking) return;
// Don't gap jump while paused, so that you don't constantly jump ahead while
// paused on a livestream.
if (this.video_.paused) return;

// When the ready state changes, we have moved on, so we should fire the large
// gap event if we see one.
Expand Down

0 comments on commit 0d5c357

Please sign in to comment.