mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-04-30 11:11:15 +00:00
fix audio notification for Gradio 4 (#1208)
the AUDIO element is now in the shadow DOM, so access it there to trigger playback
This commit is contained in:
@@ -26,7 +26,7 @@ onAfterUiUpdate(function() {
|
|||||||
lastHeadImg = headImg;
|
lastHeadImg = headImg;
|
||||||
|
|
||||||
// play notification sound if available
|
// play notification sound if available
|
||||||
const notificationAudio = gradioApp().querySelector('#audio_notification audio');
|
const notificationAudio = gradioApp().querySelector('#audio_notification #waveform > div')?.shadowRoot?.querySelector('audio');
|
||||||
if (notificationAudio) {
|
if (notificationAudio) {
|
||||||
notificationAudio.volume = opts.notification_volume / 100.0 || 1.0;
|
notificationAudio.volume = opts.notification_volume / 100.0 || 1.0;
|
||||||
notificationAudio.play();
|
notificationAudio.play();
|
||||||
|
|||||||
Reference in New Issue
Block a user