Skip to content

Commit

Permalink
fix(FEC-7335): reset subtitle display on player reset (#152)
Browse files Browse the repository at this point in the history
subtitle persist after setting new sources, need to reset the subtitle display state on reset
  • Loading branch information
OrenMe committed Oct 29, 2017
1 parent 99c671b commit f48efa1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -1252,6 +1252,7 @@ export default class Player extends FakeEventTarget {
this._pluginManager.reset();
this._eventManager.removeAll();
this._activeTextCues = [];
this._updateTextDisplay([]);
this._tracks = [];
this._firstPlay = true;
this._firstPlayInCurrentSession = false;
Expand Down
3 changes: 3 additions & 0 deletions test/src/player.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2362,13 +2362,16 @@ describe('_reset', function () {
let eventMgrSpy = sandbox.spy(player._eventManager, 'removeAll');
let pluginMgrSpy = sandbox.spy(player._pluginManager, 'reset');
let stateMgrSpy = sandbox.spy(player._stateManager, 'reset');
let _updateTextDisplay = sandbox.spy(player, '_updateTextDisplay');
player._reset();
player.paused.should.be.true;
posterMgrSpy.should.have.been.calledOnce;
eventMgrSpy.should.have.been.calledOnce;
pluginMgrSpy.should.have.been.calledOnce;
stateMgrSpy.should.have.been.calledOnce;
player._activeTextCues.should.be.empty;
_updateTextDisplay.should.have.been.calledOnce;
_updateTextDisplay.should.have.been.calledWith([]);
player._config.should.not.be.empty;
player._tracks.should.be.empty;
player._engineType.should.be.empty;
Expand Down

0 comments on commit f48efa1

Please sign in to comment.