Home > Article > Backend Development > javascript - WeChat audio interface, audio playback will not stop even if you leave the current page
<code>$(window).bind('beforeunload', function(){ if(localId) { wx.stopVoice({ localId:localId }); } }); </code>
Can’t call the wx.stopVoice interface when leaving the current page? What should I do to make the audio stop playing when I leave the page
<code>$(window).bind('beforeunload', function(){ if(localId) { wx.stopVoice({ localId:localId }); } }); </code>
Can’t call the wx.stopVoice interface when leaving the current page? What should I do to make the audio stop playing when I leave the page