(clientX: number)
| 185 | let volumeScrubbing = false; |
| 186 | |
| 187 | const handleVolumeAt = (clientX: number) => { |
| 188 | const rect = volumeSlider.getBoundingClientRect(); |
| 189 | const fraction = Math.max(0, Math.min(1, (clientX - rect.left) / rect.width)); |
| 190 | currentVolume = fraction; |
| 191 | volumeFill.style.width = `${fraction * 100}%`; |
| 192 | volumeSlider.setAttribute("aria-valuenow", String(Math.round(fraction * 100))); |
| 193 | if (isMuted && fraction > 0) callbacks.onMuteToggle(); |
| 194 | muteBtn.innerHTML = getVolumeIcon(isMuted, fraction); |
| 195 | callbacks.onVolumeChange(fraction); |
| 196 | }; |
| 197 | |
| 198 | volumeSlider.addEventListener("mousedown", (e) => { |
| 199 | e.stopPropagation(); |
no test coverage detected