Optimize setBar event and add lazy loading for thumbnails in artplayer-plugin-chapter

This commit is contained in:
Harvey Zack committed 2024-06-02 22:59:42 +08:00
1 parent aaa5ef310e
commit d99fa9447a
6 files changed
+47 -25

No files matched your search

+1 -1
View File
@@ -66,7 +66,7 @@ export default function gestureInit(art, events) {
const TOUCH_MOVE_RATIO = touchTarget === $video ? art.constructor.TOUCH_MOVE_RATIO : 1;
const currentTime = clamp(startTime + art.duration * ratio * TOUCH_MOVE_RATIO, 0, art.duration);
art.seek = currentTime;
art.emit('setBar', 'played', clamp(currentTime / art.duration, 0, 1));
art.emit('setBar', 'played', clamp(currentTime / art.duration, 0, 1), event);
art.notice.show = `${secondToTime(currentTime)} / ${secondToTime(art.duration)}`;
}
}