{“client”:{“language”:“zh_CN”,“wifiEnabled”:true,“bluetoothEnabled”:false,“deviceOrientation”:“portrait”,“locationAuthorized”:true,“notificationSoundAuthorized”:false,“screenHeight”:736,“windowHeight”:672,“system”:“iOS 12.2”,“version”:“7.0.3”,“fontSizeSetting”:17,“notificationAuthorized”:false,“statusBarHeight”:20,“windowWidth”:414,“pixelRatio”:3,“notificationBadgeAuthorized”:false,“errMsg”:“getSystemInfo:ok”,“model”:“iPhone 6 Plus”,“batteryLevel”:83,“screenWidth”:414,“locationEnabled”:true,“microphoneAuthorized”:true,“cameraAuthorized”:true,“albumAuthorized”:true,“notificationAlertAuthorized”:false,“brand”:“iPhone”,“platform”:“ios”,“SDKVersion”:“2.6.6”},“error1”:“appjs”,“msg”:“thirdScriptError\nsetBackgroundAudioState:fail jsapi has no permission, event=setBackgroundAudioState, runningState=background, permissionMsg=permission got, detail=jsapi permission required playing audio but current not playing audio in background state;at api setBackgroundAudioState fail callback function\nat fail (WAService.js:1:476988)\nat (WAService.js:1:101985)\nat (WAService.js:1:223467)\nat g (WAService.js:1:223632)\nat (WAService.js:1:224497)\nat y (WAService.js:1:1377)\nglobal code\nat (native code)\nat (WAService.js:1:1121)\nat _ (WAService.js:1:1287)\nat invoke (WAService.js:1:117616)\nat a (WAService.js:1:222024)\nat (WAService.js:1:224479)\nat (WAService.js:1:476841)\nat (WAService.js:1:101985)\nat (WAService.js:1:90334)\n_onNativeTimer\nglobal code”}
fail jsapi has no permission应该是类目没有权限,sapi permission required playing audio but current not playing audio in background state这个部分呢?我们基本上ios都会报这个错,部分安卓机型也会。是微信不准后台播放吗?
我们很简单的需求,小程序进去某个页面有十几个音频,点第一个可以播放,然后希望第一个播放完了自动播放下一个音频,
在播放下一个的时候就报这个错了。
title,epname也设置了值。
app.json里已添加:
“requiredBackgroundModes”: [
“audio”
]