媒体音量增强器
通过 Web Audio 增益节点将视频和音频音量提升至 100% 以上;重新加载页面可重置。
可复制的代码
// Boost video/audio loudness above 100% using a Web Audio gain node.
// Note: volume can only be amplified once per element; reload to reset.
var ctx = new (window.AudioContext || window.webkitAudioContext)();
var gain = ctx.createGain();
gain.gain.value = 2.5; // 250% — lower this if audio distorts.
gain.connect(ctx.destination);
document.querySelectorAll('video, audio').forEach(function (m) {
if (m.dataset.jzBoosted) return;
try {
ctx.createMediaElementSource(m).connect(gain);
m.dataset.jzBoosted = '1';
} catch (e) { /* element may already be routed */ }
});
document.addEventListener('play', function () {
if (ctx.state === 'suspended') ctx.resume();
}, true);
如何使用此示例
- 用上方按钮复制代码。
- 安装 JustZix(2 分钟),在目标页面打开扩展。
- 添加一条匹配该页面的新规则。
- 将代码粘贴到规则的 JavaScript 面板并保存 — 每次访问页面时都会运行。
为此示例评分
暂无评分 — 成为第一个。