InnerAudioContext.stop

The InnerAudioContext.stop method allows mini program developers to stop the audio playback and reset the playback position.

Sample code

copy
this.innerAudioContext = my.createInnerAudioContext();

this.innerAudioContext.src = 'https://www.sample.com/sample.mp3';
this.innerAudioContext.play();
setTimeout (() => {
  this.innerAudioContext.stop();
}, 10000);