Skip to content

Commit

Permalink
fix(player): Moved event dispatcher outside of conditional to ensure …
Browse files Browse the repository at this point in the history
…volume icon is updated accordingly
  • Loading branch information
rafa8626 committed Jan 13, 2019
1 parent bea6320 commit 5bbf745
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
8 changes: 4 additions & 4 deletions dist/openplayer.js
Expand Up @@ -6350,11 +6350,11 @@ var Volume = function () {

if (el.muted) {
el.volume = 0;
el.muted = true;
var e = events_1.addEvent('volumechange');

_this.player.getElement().dispatchEvent(e);
}

var e = events_1.addEvent('volumechange');

_this.player.getElement().dispatchEvent(e);
};

this.events.slider.input = updateVolume.bind(this);
Expand Down
2 changes: 1 addition & 1 deletion dist/openplayer.min.js

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions src/js/controls/volume.ts
Expand Up @@ -222,10 +222,9 @@ class Volume implements PlayerComponent {
const el = this.player.activeElement();
if (el.muted) {
el.volume = 0;
el.muted = true;
const e = addEvent('volumechange');
this.player.getElement().dispatchEvent(e);
}
const e = addEvent('volumechange');
this.player.getElement().dispatchEvent(e);
};
this.events.slider.input = updateVolume.bind(this);
this.events.slider.change = updateVolume.bind(this);
Expand Down

0 comments on commit 5bbf745

Please sign in to comment.