Skip to content

Commit

Permalink
Load the first item in techOrder on reset().
Browse files Browse the repository at this point in the history
  • Loading branch information
gkatsev committed Dec 7, 2015
1 parent 3ad2cf2 commit bdb15de
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -1924,13 +1924,14 @@ class Player extends Component {
}

/**
* Reset the player. Removes all sources, loads the Html tech, and calls `load`.
* Reset the player. Loads the first tech in the techOrder,
* and calls `reset` on the tech`.
*
* @return {Player} Returns the player
* @method reset
*/
reset() {
this.loadTech_('Html5', null);
this.loadTech_(toTitleCase(this.options_.techOrder[0]), null);
this.techCall_('reset');
return this;
}
Expand Down
3 changes: 3 additions & 0 deletions test/unit/player.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,9 @@ test('player#reset loads the Html5 tech and then techCalls reset', function() {
let techCallMethod;

let testPlayer = {
options_: {
techOrder: ['html5', 'flash'],
},
loadTech_(tech, source) {
loadedTech = tech;
loadedSource = source;
Expand Down

0 comments on commit bdb15de

Please sign in to comment.