diff options
author | Sam Potts <sam@potts.es> | 2018-06-20 16:53:43 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-20 16:53:43 +1000 |
commit | 20f2ddc11db39fd19f395cf4967fb5dcbcc9d5ca (patch) | |
tree | 43ee2e3847a25afa7a230da6a1940f5b70516d1e /src/js/plyr.js | |
parent | 52ea5bd0ab211cc18e7d1f6de06a78d805a94b62 (diff) | |
parent | 004528a65c334603bfd0e79222687a7fec02abcb (diff) | |
download | plyr-20f2ddc11db39fd19f395cf4967fb5dcbcc9d5ca.tar.lz plyr-20f2ddc11db39fd19f395cf4967fb5dcbcc9d5ca.tar.xz plyr-20f2ddc11db39fd19f395cf4967fb5dcbcc9d5ca.zip |
Merge pull request #1056 from friday/volume
Minor increaseVolume and decreaseVolume changes
Diffstat (limited to 'src/js/plyr.js')
-rw-r--r-- | src/js/plyr.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js index c2bb6a4d..374251e6 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -553,7 +553,7 @@ class Plyr { */ increaseVolume(step) { const volume = this.media.muted ? 0 : this.volume; - this.volume = volume + (is.number(step) ? step : 1); + this.volume = volume + (is.number(step) ? step : 0); } /** @@ -561,8 +561,7 @@ class Plyr { * @param {boolean} step - How much to decrease by (between 0 and 1) */ decreaseVolume(step) { - const volume = this.media.muted ? 0 : this.volume; - this.volume = volume - (is.number(step) ? step : 1); + this.increaseVolume(-step); } /** |