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
+7
View File
@@ -9,6 +9,13 @@
- 仓库重组为 `pc/`(局内识别)、`web/`(上分帝 Web)与 `shared/`(共享包)三层
monorepo;保留脚本直跑方式,站点内容与 `SITE_VERSION` 不变。
## [0.5.72] - 2026-07-29
### Fixed
- 上分帝 Web「主播」取消静音后默认音量改为约 35%(不再直接开到最大);用户之后
用原生滑条调大仍生效。
## [0.5.71] - 2026-07-29
### Added
+1 -1
View File
@@ -50,7 +50,7 @@ from shared.paths import (
from serve_relations import WEB_DIR, build_payload
SITE_VERSION = "0.5.71"
SITE_VERSION = "0.5.72"
DEFAULT_OSS_BASE = "https://climperor.oss-cn-shanghai.aliyuncs.com"
+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;
+1 -1
View File
@@ -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 = "";
+4 -4
View File
@@ -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>