MCPcopy Create free account
hub / github.com/XIU2/UserScript / volumeChangeEvent

Function volumeChangeEvent

HTML5Volume.user.js:124–132  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

122
123 // 音量变化事件(记住音量)
124 function volumeChangeEvent(event) {
125 if (event.target.muted) { // 判断是否静音
126 localStorage.setItem('html5_xiu_currentVolume', 0)
127 registerMenuCommand(); // 修改脚本菜单
128 } else if (localStorage.getItem('html5_xiu_currentVolume') || ((event.target.volume * 100) !== GM_getValue('menu_defaultVolume', 30))) {
129 localStorage.setItem('html5_xiu_currentVolume', event.target.volume * 100)
130 registerMenuCommand(); // 修改脚本菜单
131 }
132 }
133
134
135 // 判断该视频/音频元素是否已监听事件

Callers

nothing calls this directly

Calls 1

registerMenuCommandFunction · 0.70

Tested by

no test coverage detected