mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-27 09:41:20 -08:00
分离事件中心
This commit is contained in:
1 parent
b5694fea89
commit
1d40d1c46b
31 files changed
+728
-403
No files matched your search
@@ -0,0 +1,23 @@
|
||||
import { debounce } from '../utils';
|
||||
|
||||
export default function mousemoveInitInit(art, events) {
|
||||
const { refs: { $player } } = art;
|
||||
|
||||
const hideCursor = debounce(() => {
|
||||
$player.classList.add('artplayer-hide-cursor');
|
||||
if (art.player.fullscreenState || art.player.fullscreenWebState) {
|
||||
$player.classList.remove('artplayer-hover');
|
||||
art.controls.hide();
|
||||
}
|
||||
}, 5000);
|
||||
|
||||
events.proxy($player, 'mousemove', () => {
|
||||
$player.classList.remove('artplayer-hide-cursor');
|
||||
art.controls.show();
|
||||
if (!art.player.pipState) {
|
||||
hideCursor();
|
||||
} else {
|
||||
hideCursor.clearTimeout();
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user