Make (increase/decrease)Volume methods ignore invalid input instead of raising / lowering to the min / max

This commit is contained in:
Albin Larsson
2018-06-19 16:25:37 +02:00
parent 52ea5bd0ab
commit 43879e08f4

View File

@ -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);
}
/**
@ -562,7 +562,7 @@ class Plyr {
*/
decreaseVolume(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);
}
/**