HomeDocs
Skip to main content

stopForegroundAudio

Introduction

Stop playing audio.

Input Parameters

AttributeTypeRequiredDescription
audioPlayerIDStringYesUnique identifier for the audio task.
successFunctionNoCallback function for a successful call.
failFunctionNoCallback function for an unsuccessful call.
completeFunctionNoCallback 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");
},
});
},
});
Privacy agreementDeveloper agreementcontact us: developer_service.mi@transsion.com © 2024 MiniApp. All Rights Reserved.