新增播放器声音大小、静音、播放进度控制(#2386)

This commit is contained in:
lyswhut
2025-05-10 00:58:19 +08:00
parent 2ccca633ed
commit 021f89da29
7 changed files with 69 additions and 6 deletions
+11
View File
@@ -65,6 +65,8 @@ export const initGlobalData = () => {
lyricLineAllText: '',
lyric: '',
collect: false,
volume: 0,
mute: false,
},
}
@@ -230,6 +232,15 @@ export const listenerAppEvent = (startApp: () => void) => {
global.lx.theme.shouldUseDarkColors = shouldUseDarkColors
global.lx?.event_app.system_theme_change(shouldUseDarkColors)
})
global.lx.event_app.on('updated_config', (config, setting) => {
if (config.includes('player.volume')) {
global.lx.event_app.player_status({ volume: Math.trunc(setting['player.volume']! * 100) })
}
if (config.includes('player.isMute')) {
global.lx.event_app.player_status({ mute: setting['player.isMute'] })
}
})
}
const initTheme = () => {