fix: improve volume slider functionality

This commit is contained in:
2026-05-04 18:20:51 +02:00
parent feb842ff72
commit bf9d20e25e
2 changed files with 7 additions and 4 deletions

View File

@@ -695,11 +695,14 @@ const initPlayer = (): void => {
}
const syncVolumeUI = (): void => {
const volumeValue = video.muted ? 0 : Math.round(video.volume * 100)
if (volumeRange) {
const volumeValue = video.muted ? 0 : Math.round(video.volume * 100)
volumeRange.value = String(volumeValue)
volumeRange.style.setProperty('--volume-percent', `${volumeValue}%`)
}
if (volumeUnderline) {
volumeUnderline.style.height = `${volumeValue}%`
}
if (!video.muted && video.volume > 0) {
lastKnownVolume = video.volume
}