mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Made volume slider exponential rather than linear
This commit is contained in:
parent
6e54385460
commit
2244554a07
3 changed files with 5 additions and 4 deletions
|
@ -46,6 +46,7 @@
|
||||||
- [danieladov](https://github.com/danieladov)
|
- [danieladov](https://github.com/danieladov)
|
||||||
- [Stephane Senart](https://github.com/ssenart)
|
- [Stephane Senart](https://github.com/ssenart)
|
||||||
- [Ömer Erdinç Yağmurlu](https://github.com/omeryagmurlu)
|
- [Ömer Erdinç Yağmurlu](https://github.com/omeryagmurlu)
|
||||||
|
- [Keegan Dahm](https://github.com/keegandahm)
|
||||||
|
|
||||||
# Emby Contributors
|
# Emby Contributors
|
||||||
|
|
||||||
|
|
|
@ -457,14 +457,14 @@ class HtmlAudioPlayer {
|
||||||
setVolume(val) {
|
setVolume(val) {
|
||||||
const mediaElement = this._mediaElement;
|
const mediaElement = this._mediaElement;
|
||||||
if (mediaElement) {
|
if (mediaElement) {
|
||||||
mediaElement.volume = val / 100;
|
mediaElement.volume = Math.pow(val / 100, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getVolume() {
|
getVolume() {
|
||||||
const mediaElement = this._mediaElement;
|
const mediaElement = this._mediaElement;
|
||||||
if (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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1708,14 +1708,14 @@ function tryRemoveElement(elem) {
|
||||||
setVolume(val) {
|
setVolume(val) {
|
||||||
const mediaElement = this.#mediaElement;
|
const mediaElement = this.#mediaElement;
|
||||||
if (mediaElement) {
|
if (mediaElement) {
|
||||||
mediaElement.volume = val / 100;
|
mediaElement.volume = Math.pow(val / 100, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getVolume() {
|
getVolume() {
|
||||||
const mediaElement = this.#mediaElement;
|
const mediaElement = this.#mediaElement;
|
||||||
if (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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue