pauseForegroundAudio
Introduction
Pause the audio playback.
Parameters
| Attribute | Type | Required | Description |
|---|---|---|---|
| audioPlayerID | String | Yes | The unique identifier of the audio task. |
| success | Function | No | The callback function to execute when the API call is successful. |
| fail | Function | No | The callback function to execute when the API call fails. |
| complete | Function | No | The 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');
},
});
},
});