diff --git a/pages/API/background-audio/background-audio.uvue b/pages/API/background-audio/background-audio.uvue index 4b9d10e7cc80f067f2d510de0dfd03c9cd8a2a6b..dc02b74be8fed238498c732b0cfaa1cc05f7e00d 100644 --- a/pages/API/background-audio/background-audio.uvue +++ b/pages/API/background-audio/background-audio.uvue @@ -68,7 +68,7 @@ bgAudioMannager.title = '致爱丽丝'+this.count++; bgAudioMannager.singer = '暂无2'+this.count++; bgAudioMannager.coverImgUrl = 'https://web-assets.dcloud.net.cn/unidoc/zh/Alice.jpeg'; - this.bgAudioMannager!!.src = this.dataUrl; + this.bgAudioMannager!.src = this.dataUrl; this.bgAudioMannager?.play() }) bgAudioMannager.onPrev(() => { @@ -76,7 +76,7 @@ this.bgAudioMannager?.stop() bgAudioMannager.title = '致爱丽丝'+this.count--; bgAudioMannager.singer = '暂无'+this.count--; - this.bgAudioMannager!!.src = this.dataUrl; + this.bgAudioMannager!.src = this.dataUrl; this.bgAudioMannager?.play() }) // bgAudioMannager.onTimeUpdate((e) => { @@ -91,17 +91,17 @@ methods: { play: function () { console.log('play') - this.bgAudioMannager!!.src = this.dataUrl; + this.bgAudioMannager!.src = this.dataUrl; // #ifdef APP-ANDROID if (UTSAndroid.checkSystemPermissionGranted(UTSAndroid.getUniActivity()!, ["android.permission.POST_NOTIFICATIONS"])) { - this.bgAudioMannager!!.play() + this.bgAudioMannager!.play() } else { // 检查当前 Android 版本和 targetSdkVersion if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { // Android 13 及以上版本 if ((UTSAndroid.getAppContext() as Application).applicationInfo.targetSdkVersion >= 33) { UTSAndroid.requestSystemPermission(UTSAndroid.getUniActivity()!, ["android.permission.POST_NOTIFICATIONS"], (_ : boolean, p : string[]) => { - this.bgAudioMannager!!.play() + this.bgAudioMannager!.play() }, (_ : boolean, p : string[]) => { uni.showToast({ title: "权限被拒绝了", @@ -178,4 +178,4 @@ flex-direction: row; justify-content: center; } - \ No newline at end of file + diff --git a/pages/API/create-inner-audio-context/create-inner-audio-context.uvue b/pages/API/create-inner-audio-context/create-inner-audio-context.uvue index 93d272a5c01470b00fd4454ad014b2a01f21fbee..d3f36be4cfe57ad822edd28ed140b9d4d1d742f3 100644 --- a/pages/API/create-inner-audio-context/create-inner-audio-context.uvue +++ b/pages/API/create-inner-audio-context/create-inner-audio-context.uvue @@ -1,4 +1,7 @@