HomeDocs
Skip to main content

pauseForegroundAudio

Introduction

Pause the audio playback.

Parameters

AttributeTypeRequiredDescription
audioPlayerIDStringYesThe unique identifier of the audio task.
successFunctionNoThe callback function to execute when the API call is successful.
failFunctionNoThe callback function to execute when the API call fails.
completeFunctionNoThe callback function to execute when the API call ends (whether successful or failed).

Example

// pages/index/index.js
Page({
pauseForegroundAudio() {
dlt.pauseForegroundAudio({
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.