Skip to content

Commit

Permalink
@gkatsev cleared waiting/spinner on timeupdate. Fixes #3124. closes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
gkatsev committed Mar 7, 2016
1 parent cb3d709 commit f77bcc9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ CHANGELOG
## HEAD (Unreleased)
* @gkatsev updated videojs badges in the README ([view](https://github.com/videojs/video.js/pull/3134))
* @BrandonOCasey converted remaining text-track modules to ES6 ([view](https://github.com/videojs/video.js/pull/3130))
* @gkatsev cleared waiting/spinner on timeupdate. Fixes #3124 ([view](https://github.com/videojs/video.js/pull/3138))

--------------------

Expand Down
1 change: 1 addition & 0 deletions src/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,7 @@ class Player extends Component {
handleTechWaiting_() {
this.addClass('vjs-waiting');
this.trigger('waiting');
this.one('timeupdate', () => this.removeClass('vjs-waiting'));
}

/**
Expand Down
8 changes: 8 additions & 0 deletions test/unit/player.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -943,3 +943,11 @@ test('player#reset loads the first item in the techOrder and then techCalls rese
equal(loadedSource, null, 'with a null source');
equal(techCallMethod, 'reset', 'we then reset the tech');
});

test('Remove waiting class on timeupdate after tech waiting', function() {
let player = TestHelpers.makePlayer();
player.tech_.trigger('waiting');
ok(/vjs-waiting/.test(player.el().className), 'vjs-waiting is added to the player el on tech waiting');
player.trigger('timeupdate');
ok(!/vjs-waiting/.test(player.el().className), 'vjs-waiting is removed from the player el on timeupdate');
});

0 comments on commit f77bcc9

Please sign in to comment.