From 2fc21f8e4fdd23cb66c8978df8f2a7036d3431f8 Mon Sep 17 00:00:00 2001 From: kola-web Date: Mon, 18 Nov 2024 10:05:11 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9F=B3=E9=A2=91=E6=92=AD=E6=94=BE=E5=BF=BD?= =?UTF-8?q?=E7=95=A5ios=E9=9D=99=E9=9F=B3=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/customAudioBar/index.ts | 7 ++++--- src/module1/pages/chatRoom/index.ts | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/customAudioBar/index.ts b/src/components/customAudioBar/index.ts index bb0fe4c..566991a 100644 --- a/src/components/customAudioBar/index.ts +++ b/src/components/customAudioBar/index.ts @@ -27,15 +27,16 @@ Component({ lifetimes: { attached() { + const innerAudioContext = wx.createInnerAudioContext(); + innerAudioContext.obeyMuteSwitch = false; this.setData({ - innerAudioContext: wx.createInnerAudioContext(), + innerAudioContext, }); }, detached() { if (this.data.innerAudioContext) { this.data.innerAudioContext?.stop(); - this.data.innerAudioContext.destroy() - + this.data.innerAudioContext.destroy(); } }, }, diff --git a/src/module1/pages/chatRoom/index.ts b/src/module1/pages/chatRoom/index.ts index 473d4c0..8881ef0 100644 --- a/src/module1/pages/chatRoom/index.ts +++ b/src/module1/pages/chatRoom/index.ts @@ -62,6 +62,7 @@ Page({ this.innerAudioContext = wx.createInnerAudioContext({ useWebAudioImplement: true, }); + this.innerAudioContext.obeyMuteSwitch = false app.waitLogin().then(() => { this.getAgree();