mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 00:31:20 -08:00
fix miniProgressBar bug
This commit is contained in:
1 parent
d0fd5abcd3
commit
6824543951
3 files changed
+9
-47
No files matched your search
@@ -5,8 +5,6 @@ export default function miniProgressBar(art) {
|
||||
option: { theme },
|
||||
} = art;
|
||||
|
||||
let timer = null;
|
||||
|
||||
layers.add({
|
||||
name: 'miniProgressBar',
|
||||
style: {
|
||||
@@ -19,30 +17,14 @@ export default function miniProgressBar(art) {
|
||||
background: theme,
|
||||
},
|
||||
mounted($progressBar) {
|
||||
function hide() {
|
||||
if (timer) {
|
||||
clearTimeout(timer);
|
||||
}
|
||||
$progressBar.style.display = 'none';
|
||||
}
|
||||
|
||||
function show() {
|
||||
if (player.playing) {
|
||||
timer = setTimeout(() => {
|
||||
$progressBar.style.display = 'block';
|
||||
}, 200);
|
||||
}
|
||||
}
|
||||
|
||||
art.on('controls:show', () => {
|
||||
hide();
|
||||
$progressBar.style.display = 'none';
|
||||
});
|
||||
art.on('hoverenter', () => {
|
||||
hide();
|
||||
});
|
||||
art.on('hoverleave', () => {
|
||||
show();
|
||||
|
||||
art.on('controls:hide', () => {
|
||||
$progressBar.style.display = 'block';
|
||||
});
|
||||
|
||||
art.on('video:timeupdate', () => {
|
||||
$progressBar.style.width = `${player.played * 100}%`;
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user