diff options
| author | おさむのひと <46447427+samunohito@users.noreply.github.com> | 2023-11-21 20:05:04 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-21 20:05:04 +0900 |
| commit | 4b13179ff919e4424eb60a37db0e72df4bd12101 (patch) | |
| tree | 176a7b06e84dad0706cd3fb2a23cb2af8e42b6b9 /packages/frontend/src/widgets | |
| parent | 広告掲載ページにてfilterをわかりやすく (#12385) (diff) | |
| download | misskey-4b13179ff919e4424eb60a37db0e72df4bd12101.tar.gz misskey-4b13179ff919e4424eb60a37db0e72df4bd12101.tar.bz2 misskey-4b13179ff919e4424eb60a37db0e72df4bd12101.zip | |
サウンド再生方法の変更に追従できていなかった所を修正 (#12368)
Co-authored-by: osamu <46447427+sam-osamu@users.noreply.github.com>
Diffstat (limited to 'packages/frontend/src/widgets')
| -rw-r--r-- | packages/frontend/src/widgets/WidgetJobQueue.vue | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/packages/frontend/src/widgets/WidgetJobQueue.vue b/packages/frontend/src/widgets/WidgetJobQueue.vue index 89770b2216..fa82997570 100644 --- a/packages/frontend/src/widgets/WidgetJobQueue.vue +++ b/packages/frontend/src/widgets/WidgetJobQueue.vue @@ -99,7 +99,10 @@ const current = reactive({ }, }); const prev = reactive({} as typeof current); -const jammedSound = sound.setVolume(sound.getAudio('syuilo/queue-jammed'), 1); +let jammedAudioBuffer: AudioBuffer | null = $ref(null); +let jammedSoundNodePlaying: boolean = $ref(false); + +sound.loadAudio('syuilo/queue-jammed').then(buf => jammedAudioBuffer = buf); for (const domain of ['inbox', 'deliver']) { prev[domain] = deepClone(current[domain]); @@ -113,8 +116,13 @@ const onStats = (stats) => { current[domain].waiting = stats[domain].waiting; current[domain].delayed = stats[domain].delayed; - if (current[domain].waiting > 0 && widgetProps.sound && jammedSound.paused) { - jammedSound.play(); + if (current[domain].waiting > 0 && widgetProps.sound && jammedAudioBuffer && !jammedSoundNodePlaying) { + const soundNode = sound.createSourceNode(jammedAudioBuffer, 1); + if (soundNode) { + jammedSoundNodePlaying = true; + soundNode.onended = () => jammedSoundNodePlaying = false; + soundNode.start(); + } } } }; |