mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-23 13:51:20 -08:00
refactor: Simplify thumbnails implementation in Artplayer
This commit is contained in:
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user