【发布时间】:2026-02-01 05:50:01
【问题描述】:
我正在研究设置一个脚本,该脚本将显示某些音符以及伴随的音乐曲目。基本上我需要在音轨中的某些时间来触发事件。我已经看到我可以使用类似于以下的 currentTime ,但是我正在寻找一种很好的方法来制作一个简洁的函数来在帧之间移动并在有倒带等情况下来回移动。非常感谢帮助!
$("#ogg_player_1_obj").bind('timeupdate', notePosition);
function notePosition(){
myVid=document.getElementById("ogg_player_1_obj");
mct=myVid.currentTime;
//SET Frame based on time???
}
【问题讨论】:
-
你想在notePosition()中做什么?在我看来,您回答了标题中的问题。只需几个 if 语句,您就完成了。
-
我需要显示对应于某个时间的某个帧
-
你看过使用 popcorn.js 吗? popcornjs.org
标签: javascript jquery audio html5-audio