- 小程序录音授权成功wx.authorize({scope: 'scope.record'})bug
每次点击录音按钮执行以下代码,第一次出现授权,授权成功,之后多次点击按钮,会稳定复现进入 fail回掉函数,返回值如图[图片] wx.authorize({ scope: 'scope.record', success: (res) => { console.log('-success', res) if (res.errMsg === 'authorize:ok') { this.listenRecord() } }, fail: (res) => { console.log('-fail', res) wx.showModal({ title: '提示', content: '您未授权录音,功能将无法使用', showCancel: true, confirmText: "授权", success: (res) => { if (res.confirm) { wx.openSetting({ success: (res) => { if (!res.authSetting['scope.record']) { wx.showModal({ title: '提示', content: '您未授权录音,功能将无法使用', showCancel: false }) } else { // this.listenRecord() } }, fail: function () { wx.showToast({ title: '授权设置录音失败, 请重新设置', }) } }) } } }) } })
2022-10-19 - 播放 wav 音频 ios 手机 wx.createInnerAudioContext 播放报错 ?
安卓手机 和 模拟器都可以,ios 手机不行 苹果 12 ios 15.5 微信版本 8.0.28 {errMsg: "INNERERRCODE:-16041, ERRMSG:未能完成操作。(CoreMediaErrorDomain错误-16041。)", errCode: 10001} const innerAudioContext = wx.createInnerAudioContext({ useWebAudioImplement: false }) innerAudioContext.src = 'https://records.ai-ym.com/ddm/6325316887bc9477447f3946' innerAudioContext.onError((error) => { console.log('radio error', error) }) innerAudioContext.play()
2022-09-17 - wx-open-launch-app 标签内容不展示,用的本地代理线上80端口,求解?
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title><%= htmlWebpackPlugin.options.title %></title> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui, viewport-fit=cover"> <script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script> </head> <body> <div class='aaa'> <wx-open-launch-app id="launch-btn" appid="wx00819c646xxxx8" extinfo="your-extinfo111"> <template> <style> .btn { width: 200px; height: 45px; line-height: 45px; text-align: center; font-size: 17px; border-radius: 22.5px; color: #fff; } </style> <button class="btn">App内查看<button> </template> </wx-open-launch-app> </div> <script> var btn = document.getElementById('launch-btn'); console.log('btn', btn) btn.addEventListener('launch', function (e) { alert('111') console.log('success'); }); btn.addEventListener('error', function (e) { alert('222') console.log('fail', e.detail); }); </script> </body> </html> wx.config(....) 配置也正确 wx.ready 也能够成功相应
2020-06-09