seekForegroundAudio
Introduction
Seek audio playback progress.
Input Parameters
Attribute | Type | Required | Description |
---|---|---|---|
audioPlayerID | String | Yes | Unique identifier for the audio task. |
position | Number | Yes | Time in seconds (supports up to millisecond precision). |
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({
seekForegroundAudio() {
dlt.seekForegroundAudio({
audioPlayerID: "bgmId",
position: 5,
success: function () {
console.log("success");
},
fail: function () {
console.log("fail");
},
complete: function () {
console.log("complete");
},
});
},
});