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();