InnerAudioContext.offSeeked收藏我的收藏
收藏
我的收藏基础库 1.0.0 开始支持本方法。
取消监听音频完成 seek 操作的事件。
语法
InnerAudioContext.offSeeked(callback)
参数说明
Function callback
代码示例
const dataUrl = "https://someaudiourl"; // 合法的音频资源地址
const innerAudioContext = tt.createInnerAudioContext();
innerAudioContext.autoplay = true;
innerAudioContext.src = dataUrl;
innerAudioContext.onError((error) => {
tt.showToast({ title: "音频播放失败" });
});
function onseeked() {
tt.showToast({ title: "跳转完成" });
}
innerAudioContext.onSeeked(onseeked);
innerAudioContext.offSeeked(onseeked);
setTimeout(() => innerAudioContext.seek(3), 1000);
Bug & Tip
暂无。