mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-23 13:51:20 -08:00
fix bug
This commit is contained in:
1 parent
769855be79
commit
078507356a
3 files changed
+33
-11
No files matched your search
@@ -18,18 +18,29 @@ export default function miniProgressBar(art) {
|
||||
background: theme,
|
||||
},
|
||||
mounted($progressBar) {
|
||||
art.on('hoverenter', () => {
|
||||
function hide() {
|
||||
if (timer) {
|
||||
clearTimeout(timer);
|
||||
}
|
||||
$progressBar.style.display = 'none';
|
||||
});
|
||||
art.on('hoverleave', () => {
|
||||
}
|
||||
|
||||
function show() {
|
||||
if (player.playing) {
|
||||
timer = setTimeout(() => {
|
||||
$progressBar.style.display = 'block';
|
||||
}, 200);
|
||||
}
|
||||
}
|
||||
|
||||
art.on('controls:show', () => {
|
||||
hide();
|
||||
});
|
||||
art.on('hoverenter', () => {
|
||||
hide();
|
||||
});
|
||||
art.on('hoverleave', () => {
|
||||
show();
|
||||
});
|
||||
art.on('video:timeupdate', () => {
|
||||
$progressBar.style.width = `${player.played * 100}%`;
|
||||
|
||||
Reference in new issue
Block a user