refactor: Simplify thumbnails implementation in Artplayer

This commit is contained in:
Harvey Zack committed 2024-08-15 23:08:33 +08:00
1 parent 3e3b38fe07
commit 65b0b2c53f
5 files changed
+17 -41

No files matched your search

@@ -46,14 +46,15 @@ export default function thumbnailsMix(art) {
art.on('setBar', async (type, percentage, event) => {
const $thumbnails = art.controls?.thumbnails;
if (!$thumbnails) return;
const { url } = option.thumbnails;
if (!$thumbnails || !url) return;
const isMobileDroging = type === 'played' && event && isMobile;
if (type === 'hover' || isMobileDroging) {
if (!loading) {
loading = true;
image = await loadImg(option.thumbnails.url);
image = await loadImg(url);
isLoad = true;
}