最佳答案
最好的方法是使用addCues:
function addBookmark() {
var currentTimeRound = Math.round(vid.currentTime);
var resultBookMark = cues.find(function(element) {
return element.begin === currentTimeRound;
});
if(!resultBookMark){
bookmarkList.push(currentTimeRound);
var newBookmark = [{begin: currentTimeRound, text: "New bookmark"}];
playerInstance.addCues(newBookmark);
}
}