mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-18 02:21:20 -08:00
fix miniProgressBar timer
This commit is contained in:
1 parent
87d068dd68
commit
769855be79
3 files changed
+21
-7
No files matched your search
@@ -5,6 +5,8 @@ export default function miniProgressBar(art) {
|
||||
option: { theme },
|
||||
} = art;
|
||||
|
||||
let timer = null;
|
||||
|
||||
layers.add({
|
||||
style: {
|
||||
display: 'none',
|
||||
@@ -17,11 +19,16 @@ export default function miniProgressBar(art) {
|
||||
},
|
||||
mounted($progressBar) {
|
||||
art.on('hoverenter', () => {
|
||||
if (timer) {
|
||||
clearTimeout(timer);
|
||||
}
|
||||
$progressBar.style.display = 'none';
|
||||
});
|
||||
art.on('hoverleave', () => {
|
||||
if (player.playing) {
|
||||
$progressBar.style.display = 'block';
|
||||
timer = setTimeout(() => {
|
||||
$progressBar.style.display = 'block';
|
||||
}, 200);
|
||||
}
|
||||
});
|
||||
art.on('video:timeupdate', () => {
|
||||
|
||||
Reference in new issue
Block a user