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:
+18
-2
@@ -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;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Local defaults; production export overwrites via export_relations_site.py. */
|
||||
var SITE_VERSION = "0.5.71";
|
||||
var SITE_VERSION = "0.5.72";
|
||||
var ABILITY_VIDEO_BASE = "";
|
||||
var STATIC_ASSET_BASE = "";
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>DOTA2 上分帝</title>
|
||||
<link rel="icon" href="/ui-icon/dota2_logo.png" type="image/png" />
|
||||
<link rel="stylesheet" href="/style.css?v=0.5.71" />
|
||||
<link rel="stylesheet" href="/style.css?v=0.5.72" />
|
||||
</head>
|
||||
<body>
|
||||
<header class="topbar">
|
||||
@@ -149,8 +149,8 @@
|
||||
|
||||
<section class="detail" id="detail" aria-live="polite"></section>
|
||||
|
||||
<script src="/config.js?v=0.5.71"></script>
|
||||
<script src="/router.js?v=0.5.71"></script>
|
||||
<script src="/app.js?v=0.5.71"></script>
|
||||
<script src="/config.js?v=0.5.72"></script>
|
||||
<script src="/router.js?v=0.5.72"></script>
|
||||
<script src="/app.js?v=0.5.72"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user