HomeDocs
跳到主要内容

playForegroundAudio

简介

播放音频

入参

属性类型必填描述
audioPlayerIDString音频任务的唯一标识
successFunction接口调用成功的回调函数
failFunction接口调用失败的回调函数
completeFunction接口调用结束的回调函数(调用成功、失败都会执行)

使用示例

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