| | |
| | | method, |
| | | }) { |
| | | if (this.requestLock) { |
| | | console.warn("该请求被锁定,不能重复请求!!!") |
| | | console.log("该请求被锁定,不能重复请求!!!") |
| | | return |
| | | } |
| | | |
| | | this.requestLock = true |
| | | return new Promise((resolve, reject) => { |
| | | // that = that || this; |
| | |
| | | innerAudioContext.play(); // 播放音频 |
| | | |
| | | innerAudioContext.onPlay(() => { |
| | | console.log('开始播放'); |
| | | //console.log('开始播放'); |
| | | }); |
| | | innerAudioContext.onError((res) => { |
| | | console.log(res.errMsg); |
| | | console.log(res.errCode); |
| | | }); |
| | | innerAudioContext.onPause(function() { |
| | | console.log('播放出现错误,销毁'); |
| | | //console.log('播放暂停,销毁'); |
| | | innerAudioContext.destroy(); |
| | | }) |
| | | } |