HomeDocs
Skip to main content

seekForegroundAudio

Introduction​

Seek audio playback progress.

Input Parameters​

AttributeTypeRequiredDescription
audioPlayerIDStringYesUnique identifier for the audio task.
positionNumberYesTime in seconds (supports up to millisecond precision).
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({
seekForegroundAudio() {
dlt.seekForegroundAudio({
audioPlayerID: "bgmId",
position: 5,
success: function () {
console.log("success");
},
fail: function () {
console.log("fail");
},
complete: function () {
console.log("complete");
},
});
},
});
Privacy agreementDeveloper agreementcontact us: developer_private.mi@dlightek.com © 2024 MiniApp. All Rights Reserved.