mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-27 17:51:20 -08:00
压缩字符
This commit is contained in:
1 parent
7ff61b4660
commit
0cf455ced3
27 files changed
+171
-239
No files matched your search
@@ -1,7 +1,5 @@
|
||||
export default function clickInit(art, events) {
|
||||
const {
|
||||
template: { $player },
|
||||
} = art;
|
||||
const { $player } = art.template;
|
||||
events.proxy(document, ['click', 'contextmenu'], event => {
|
||||
if (event.composedPath().indexOf($player) > -1) {
|
||||
art.isFocus = true;
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import { addClass, removeClass } from '../utils';
|
||||
|
||||
export default function hoverInit(art, events) {
|
||||
const {
|
||||
template: { $player },
|
||||
} = art;
|
||||
const { $player } = art.template;
|
||||
events.hover(
|
||||
$player,
|
||||
() => {
|
||||
|
||||
@@ -4,12 +4,13 @@ export default function mousemoveInitInit(art, events) {
|
||||
const {
|
||||
template: { $player, $video },
|
||||
player,
|
||||
controls,
|
||||
} = art;
|
||||
|
||||
const autoHide = debounce(() => {
|
||||
addClass($player, 'art-hide-cursor');
|
||||
removeClass($player, 'art-hover');
|
||||
art.controls.show = false;
|
||||
controls.show = false;
|
||||
}, 3000);
|
||||
|
||||
art.on('hoverleave', () => {
|
||||
@@ -21,8 +22,8 @@ export default function mousemoveInitInit(art, events) {
|
||||
events.proxy($player, 'mousemove', event => {
|
||||
autoHide.clearTimeout();
|
||||
removeClass($player, 'art-hide-cursor');
|
||||
art.controls.show = true;
|
||||
if (!art.player.pip && player.playing && event.target === $video) {
|
||||
controls.show = true;
|
||||
if (!player.pip && player.playing && event.target === $video) {
|
||||
autoHide();
|
||||
}
|
||||
art.emit('mousemove');
|
||||
|
||||
@@ -19,13 +19,13 @@ export default function resizeInit(art, events) {
|
||||
playerWidth = player.width;
|
||||
playerHeight = player.height;
|
||||
if (option.autoSize) {
|
||||
if (!art.player.fullscreen && !art.player.fullscreenWeb && !art.player.pip) {
|
||||
art.player.autoSize = true;
|
||||
if (!player.fullscreen && !player.fullscreenWeb && !player.pip) {
|
||||
player.autoSize = true;
|
||||
} else {
|
||||
art.player.autoSize = false;
|
||||
player.autoSize = false;
|
||||
}
|
||||
}
|
||||
art.player.aspectRatioReset = true;
|
||||
player.aspectRatioReset = true;
|
||||
art.emit('resize', {
|
||||
width: player.width,
|
||||
height: player.height,
|
||||
|
||||
Reference in new issue
Block a user