Skip to main content
Version: Next


Obtains the globally unique background audio manager. The playback of an audio file continues when the Mini Program is switched to the background. However, the audio playback status at the background cannot be controlled by calling an API.

As of WeChat 6.7.2, you need to configure the requiredBackgroundModes attribute in app.json in order to continue playing an audio file after the Mini Program switches to the background. This property takes effect directly in the developer and demo versions, but must be approved before working in the official version.



() => BackgroundAudioManager


Sample Code

const backgroundAudioManager = Taro.getBackgroundAudioManager()
backgroundAudioManager.title = 'At this Very Moment'
backgroundAudioManager.epname = 'At this Very Moment'
backgroundAudioManager.singer = 'Xu Wei'
backgroundAudioManager.coverImgUrl = ''
// Plays automatically after src is set
backgroundAudioManager.src = ''

API Support

APIWeChat Mini-ProgramH5React Native