mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-21 04:31:20 -08:00
Optimize setBar event and add lazy loading for thumbnails in artplayer-plugin-chapter
This commit is contained in:
1 parent
0e58ce8cd9
commit
aaa5ef310e
5 files changed
+48
-37
No files matched your search
@@ -64,9 +64,7 @@ export default function artplayerPluginChapter({ chapters = [] }) {
|
||||
}
|
||||
});
|
||||
|
||||
art.proxy($progress, 'mousemove', (event) => {
|
||||
if (!$chapters.length) return;
|
||||
|
||||
function showTitle(event) {
|
||||
const $target = event.target.closest('.art-chapter');
|
||||
if ($target) {
|
||||
setStyle($title, 'display', 'flex');
|
||||
@@ -85,12 +83,19 @@ export default function artplayerPluginChapter({ chapters = [] }) {
|
||||
} else {
|
||||
setStyle($title, 'display', 'none');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
art.proxy($progress, 'mouseleave', () => {
|
||||
if (!$chapters.length) return;
|
||||
setStyle($title, 'display', 'none');
|
||||
});
|
||||
if (!isMobile) {
|
||||
art.proxy($progress, 'mousemove', (event) => {
|
||||
if (!$chapters.length) return;
|
||||
showTitle(event);
|
||||
});
|
||||
|
||||
art.proxy($progress, 'mouseleave', () => {
|
||||
if (!$chapters.length) return;
|
||||
setStyle($title, 'display', 'none');
|
||||
});
|
||||
}
|
||||
|
||||
art.on('video:loadedmetadata', () => {
|
||||
$control.innerText = '';
|
||||
|
||||
Reference in new issue
Block a user