mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-11 22:06:17 -08:00
13 lines
372 B
JavaScript
13 lines
372 B
JavaScript
export default function clickInit(art, events) {
|
|
const { $player } = art.template;
|
|
events.proxy(document, ['click', 'contextmenu'], event => {
|
|
if (event.composedPath().indexOf($player) > -1) {
|
|
art.isFocus = true;
|
|
art.emit('focus');
|
|
} else {
|
|
art.isFocus = false;
|
|
art.emit('blur');
|
|
}
|
|
});
|
|
}
|