mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 00:31:20 -08:00
fix highlight display
This commit is contained in:
1 parent
70fd29429e
commit
f682321d25
4 files changed
+21
-15
No files matched your search
@@ -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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user