Skip to content
Permalink
Browse files

Merge pull request #3331 from jwplayer/bugfix/reset-cues-on-playlistItem

Clear model cues on playlist item in controller
  • Loading branch information...
robwalch committed Mar 15, 2019
2 parents fe005c3 + 0a465a1 commit fad56031cf632d75e01fe28d52994a8cb07e7f89
Showing with 7 additions and 4 deletions.
  1. +3 −4 src/js/view/controls/components/timeslider.js
  2. +4 −0 test/unit/controlbar-test.js
@@ -101,11 +101,13 @@ class TimeSlider extends Slider {
this.updateAriaText();
}
})
.change('playlistItem', this.onPlaylistItem, this)
.change('position', this.onPosition, this)
.change('buffer', this.onBuffer, this)
.change('streamType', this.onStreamType, this);

// Clear cues on player model's playlistItem change event
this._model.player.change('playlistItem', this.onPlaylistItem, this);

const sliderElement = this.el;
setAttribute(sliderElement, 'tabindex', '0');
setAttribute(sliderElement, 'role', 'slider');
@@ -173,9 +175,6 @@ class TimeSlider extends Slider {
}

onPlaylistItem(model, playlistItem) {
if (!playlistItem) {
return;
}
this.reset();
model.set('cues', []);

@@ -14,6 +14,10 @@ describe('Control Bar', function() {
model.mediaController = {};
model.mediaController.on = sinon.stub();
model.mediaController.on.returnsThis();
const playerModel = new SimpleModel();
playerModel.change = sinon.stub();
playerModel.change.returnsThis();
model.player = playerModel;

let accessibilityContainer;
let controlBar;

0 comments on commit fad5603

Please sign in to comment.
You can’t perform that action at this time.