InnerAudioContext.offTimeUpdate
基础库 1.0.0 开始支持本方法。
取消监听 timeUpdate 事件。
语法
InnerAudioContext.offTimeUpdate(callback)
参数说明
Function callback
代码示例
const dataUrl = "https://someaudiourl"; // 合法的音频资源地址
const innerAudioContext = tt.createInnerAudioContext();
innerAudioContext.autoplay = true;
innerAudioContext.src = dataUrl;
innerAudioContext.onError((error) => {
tt.showModal({
title: "播放出错",
content: `详细错误信息:${error.errMsg}`,
});
console.log("播放出错", error);
});
function ontimeupdate() {
tt.showToast({ title: "音频播放进度更新" });
}
innerAudioContext.onTimeUpdate(ontimeupdate);
innerAudioContext.offTimeUpdate(ontimeupdate);
Bug & Tip
暂无。
点击纠错
该文档是否对你的开发有所帮助?
有帮助
没帮助
该文档是否对你的开发有所帮助?
有帮助
没帮助