使用uni.createInnerAudioContext(),播放语音
1.在windows版本的hbuiderx 1.9.3打包的iOS可以播放音频,但是报以下错误信息,并且循环播放,安卓正常播放
[ERROR] : appServiceSDKScriptError
14:54:53.714 Can't find variable: nan;at api onAudioStateChange callback function
14:54:53.714 eval code
14:54:53.714 eval@[native code]
14:54:53.715 execSync
14:54:53.715 execSync2
14:54:53.715 getDuration
14:54:53.715 getAudioState@app-service.js:3:75645
14:54:53.715 Un@app-service.js:3:77415
14:54:53.716 app-service.js:4:844
14:54:53.716 invoke@app-service.js:4:889
14:54:53.716 invoke@app-service.js:4:105643
14:54:53.716 X@app-service.js:4:163217
14:54:53.717 app-service.js:4:170670
14:54:53.717 hc@app-service.js:4:310445
14:54:53.717 app-service.js:4:311579
14:54:53.718 app-service.js:4:164893
14:54:53.718 subscribeHandler@app-service.js:4:1563
14:54:53.718 P@app-service.js:3:5118
14:54:53.718 callbackFromNative
14:54:53.719 nativeEval
14:54:53.719 global code
14:54:53.768 [ERROR] : appServiceSDKScriptError
14:54:53.769 Can't find variable: nan;at api onAudioStateChange callback function
14:54:53.769 eval code
14:54:53.770 eval@[native code]
14:54:53.770 execSync
14:54:53.771 execSync2
14:54:53.772 getDuration
14:54:53.772 getAudioState@app-service.js:3:75645
14:54:53.773 Un@app-service.js:3:77415
14:54:53.773 app-service.js:4:844
14:54:53.773 invoke@app-service.js:4:889
14:54:53.773 invoke@app-service.js:4:105643
14:54:53.774 X@app-service.js:4:163217
14:54:53.774 app-service.js:4:170670
14:54:53.774 hc@app-service.js:4:310445
14:54:53.774 app-service.js:4:311579
14:54:53.775 app-service.js:4:164893
14:54:53.775 subscribeHandler@app-service.js:4:1563
14:54:53.775 P@app-service.js:3:5118
14:54:53.775 callbackFromNative
14:54:53.776 nativeEval
14:54:53.776 global code
14:54:53.776 [ERROR] : appServiceSDKScriptError
14:54:53.777 Can't find variable: nan;at api onAudioStateChange callback function
14:54:53.777 eval code
14:54:53.777 eval@[native code]
14:54:53.778 execSync
14:54:53.778 execSync2
14:54:53.778 getDuration
14:54:53.779 getAudioState@app-service.js:3:75645
14:54:53.779 Un@app-service.js:3:77415
14:54:53.779 app-service.js:4:844
14:54:53.779 invoke@app-service.js
2.在Mac版的hbuiderx 1.9.4版本中,iOS不能正常语音播放,但是打印播放结束的回调,没有报错,安卓可以正常播放
1***@qq.com (作者)
iOS12.2,苹果5s
2019-05-14 14:22