getBackgroundAudioManager IOS 没有声音
发布于 5 年前 作者 taoguiying 7907 次浏览 来自 官方Issues

用wx.getBackgroundAudioManager()创建了一个实例 然后改变src模拟器上正常 真机没声音

wx.createInnerAudioContext()创建了一个实例 真机模拟器都正常

但是我想这个音乐可以后台播放所以用getBackgroundAudioManager 但是没声音 这个问题要怎么解决

Page({
  onTap1(event) {
    const bgm = wx.getBackgroundAudioManager()
    bgm.title = '就是我'
    bgm.singer = 'AWOLNATION'
    bgm.epname = 'CSGO'
    bgm.coverImgUrl = 'https://www.csgola.com/Public/img/music_kits/awolnation_01.png'
    bgm.src = 'https://www.csgola.com/Public/csgo_music/awolnation_01/roundmvpanthem.mp3'
  },

  onTap2(event) {
    const innerAudioContext = wx.createInnerAudioContext()
    innerAudioContext.src = 'https://www.csgola.com/Public/csgo_music/awolnation_01/roundmvpanthem.mp3'
    innerAudioContext.play()
  },
})

1 回复

你好,这种情况可以先确认一下是否开启了静音。

回到顶部