fix highlight display

This commit is contained in:
Harvey Zack committed 2022-05-19 07:16:41 +08:00
1 parent 70fd29429e
commit f682321d25
4 files changed
+21 -15

No files matched your search

+10 -8
View File
@@ -102,14 +102,16 @@ export default function progress(options) {
}
}
for (let index = 0; index < option.highlight.length; index++) {
const item = option.highlight[index];
const left = (clamp(item.time, 0, art.duration) / art.duration) * 100;
append(
$highlight,
`<span data-text="${item.text}" data-time="${item.time}" style="left: ${left}%"></span>`,
);
}
art.once('video:loadedmetadata', () => {
for (let index = 0; index < option.highlight.length; index++) {
const item = option.highlight[index];
const left = (clamp(item.time, 0, art.duration) / art.duration) * 100;
append(
$highlight,
`<span data-text="${item.text}" data-time="${item.time}" style="left: ${left}%"></span>`,
);
}
});
setBar('loaded', art.loaded);