mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-18 13:42:06 +00:00
use .toFixed(2) on volume decimals
This commit is contained in:
@ -135,7 +135,7 @@ function changeVolume(toIncrease, options) {
|
|||||||
const steps = (options.steps || 1) / 100;
|
const steps = (options.steps || 1) / 100;
|
||||||
videoStream.volume = toIncrease ?
|
videoStream.volume = toIncrease ?
|
||||||
Math.min(videoStream.volume + steps, 1) :
|
Math.min(videoStream.volume + steps, 1) :
|
||||||
Math.max(videoStream.volume - steps, 0);
|
Math.max(videoStream.volume - steps, 0).toFixed(2);
|
||||||
|
|
||||||
// Save the new volume
|
// Save the new volume
|
||||||
saveVolume(toPercent(videoStream.volume), options);
|
saveVolume(toPercent(videoStream.volume), options);
|
||||||
@ -156,7 +156,7 @@ function setupVolumeOverride(options) {
|
|||||||
|
|
||||||
video.addEventListener("canplay", () => {
|
video.addEventListener("canplay", () => {
|
||||||
if (typeof options.savedVolume === "number") {
|
if (typeof options.savedVolume === "number") {
|
||||||
const newVolume = options.savedVolume / 100;
|
const newVolume = (options.savedVolume / 100).toFixed(2);
|
||||||
|
|
||||||
video.volume = newVolume;
|
video.volume = newVolume;
|
||||||
updateVolumeSlider(options);
|
updateVolumeSlider(options);
|
||||||
|
|||||||
Reference in New Issue
Block a user