v0.5.72: lower default streamer unmute volume.

Avoid blasting to max when users unmute highlight clips; keep native slider control afterward.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
voson
2026-07-29 16:06:00 +08:00
co-authored by Cursor
parent d2cfcd7461
commit 7681fdb069
5 changed files with 31 additions and 8 deletions
+18 -2
View File
@@ -3811,6 +3811,9 @@ function pauseOtherStreamerVideos(current) {
});
}
/** Comfortable default when user unmutes (native controls start at 1.0). */
const STREAMER_VIDEO_DEFAULT_VOLUME = 0.35;
/** Per-clip opt-in: user unmutes via native video controls only. */
function streamerVideoUserSoundOn(video) {
return video instanceof HTMLVideoElement && video.dataset.streamerSoundOn === "1";
@@ -3820,8 +3823,20 @@ function bindStreamerVideoSoundToggle(video) {
if (!(video instanceof HTMLVideoElement) || video.dataset.streamerSoundBound) return;
video.dataset.streamerSoundBound = "1";
video.addEventListener("volumechange", () => {
if (video.muted) delete video.dataset.streamerSoundOn;
else video.dataset.streamerSoundOn = "1";
if (video.muted) {
delete video.dataset.streamerSoundOn;
return;
}
video.dataset.streamerSoundOn = "1";
// First unmute: if still at browser max, drop to a comfortable level once.
// Later slider moves (including intentional max) are left alone.
if (
video.dataset.streamerVolComfort !== "1" &&
video.volume >= 0.98
) {
video.volume = STREAMER_VIDEO_DEFAULT_VOLUME;
}
video.dataset.streamerVolComfort = "1";
});
}
@@ -4280,6 +4295,7 @@ function buildStreamerCard(row) {
// Autoplay muted; user unmutes via native controls when they want sound.
video.muted = true;
video.setAttribute("muted", "");
video.volume = STREAMER_VIDEO_DEFAULT_VOLUME;
const posterSrc = streamerVideoPosterSrc(row);
if (posterSrc) {
video.poster = posterSrc;