Skip to main content
Creates a foreground audio context (InnerAudioContext) for managing audio playback in the Mini Program: play, pause, stop, play from a specific time, and configure volume and looping. Foreground audio stops automatically when the user exits the Mini Program or the screen turns off.

Return Value

InnerAudioContext Properties

Assigning an invalid value to a writable property has no effect.

InnerAudioContext Methods

InnerAudioContext Events

Each on* method registers a listener; the matching off* method removes the listener passed in, or all listeners of that event if none is passed.

onError Error Codes

Code Example

my.getRecorderManager

Record audio

my.createVideoContext

Control video playback