Made volume slider exponential rather than linear

This commit is contained in:
Keegan Dahm 2021-08-07 07:26:28 -07:00
parent 6e54385460
commit 2244554a07
3 changed files with 5 additions and 4 deletions

View file

@ -1708,14 +1708,14 @@ function tryRemoveElement(elem) {
setVolume(val) {
const mediaElement = this.#mediaElement;
if (mediaElement) {
mediaElement.volume = val / 100;
mediaElement.volume = Math.pow(val / 100, 2);
}
}
getVolume() {
const mediaElement = this.#mediaElement;
if (mediaElement) {
return Math.min(Math.round(mediaElement.volume * 100), 100);
return Math.min(Math.round(Math.pow(mediaElement.volume, 0.5) * 100), 100);
}
}