my.createInnerAudioContext

The my.createInnerAudioContext JSAPI is called by mini program developers to create a foreground audio context for managing audio playback in mini programs. The foreground audio stops automatically if the user exits the mini program or if the screen turns off.

Return value

Type

Required

Description

InnerAudioContext

Yes

This object serves as a foreground audio manager, providing various methods and properties to control audio playback.

Sample code

copy
this.innerAudioContext = my.createInnerAudioContext ();