fix: stopAll只suspend不resume,防止停止后声音立即恢复
This commit is contained in:
@@ -322,8 +322,7 @@ function stopAll() {
|
|||||||
// Stop any Web Audio sources
|
// Stop any Web Audio sources
|
||||||
const ctx = getAudioContext()
|
const ctx = getAudioContext()
|
||||||
if (ctx && ctx.state === "running") {
|
if (ctx && ctx.state === "running") {
|
||||||
// Suspending and resuming is the cleanest way to halt all sources
|
ctx.suspend().catch(() => {})
|
||||||
ctx.suspend().then(() => ctx.resume()).catch(() => {})
|
|
||||||
}
|
}
|
||||||
// Stop HTML pool elements
|
// Stop HTML pool elements
|
||||||
for (const el of htmlPool) {
|
for (const el of htmlPool) {
|
||||||
|
|||||||
Reference in New Issue
Block a user