stopForegroundAudio
Introduction
Stop playing audio.
Input Parameters
Attribute | Type | Required | Description |
---|---|---|---|
audioPlayerID | String | Yes | Unique identifier for the audio task. |
success | Function | No | Callback function for a successful call. |
fail | Function | No | Callback function for an unsuccessful call. |
complete | Function | No | Callback function for the completion of the call (executed for both successful and unsuccessful calls). |
Usage Example
// pages/index/index.js
Page({
stopForegroundAudio() {
dlt.stopForegroundAudio({
audioPlayerID: "bgmId",
success: function () {
console.log("success");
},
fail: function () {
console.log("fail");
},
complete: function () {
console.log("complete");
},
});
},
});