mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 08:51:20 -08:00
add art.isInput
This commit is contained in:
1 parent
3741f876d5
commit
2b934ab988
5 files changed
+10
-4
No files matched your search
@@ -36,7 +36,7 @@ export default class Control extends Component {
|
||||
});
|
||||
|
||||
art.on('video:timeupdate', () => {
|
||||
if (!art.isFocus && art.playing && this.show && Date.now() - activeTime >= constructor.CONTROL_HIDE_TIME) {
|
||||
if (!art.isInput && art.playing && this.show && Date.now() - activeTime >= constructor.CONTROL_HIDE_TIME) {
|
||||
this.show = false;
|
||||
addClass($player, 'art-hide-cursor');
|
||||
removeClass($player, 'art-hover');
|
||||
|
||||
@@ -8,9 +8,11 @@ export default function clickInit(art, events) {
|
||||
|
||||
events.proxy(document, ['click', 'contextmenu'], (event) => {
|
||||
if (includeFromEvent(event, $player)) {
|
||||
art.isInput = event.target.tagName === 'INPUT';
|
||||
art.isFocus = true;
|
||||
art.emit('focus');
|
||||
} else {
|
||||
art.isInput = false;
|
||||
art.isFocus = false;
|
||||
art.emit('blur');
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ export default class Artplayer extends Emitter {
|
||||
|
||||
this.isReady = false;
|
||||
this.isFocus = false;
|
||||
this.isInput = false;
|
||||
this.isDestroy = false;
|
||||
|
||||
this.whitelist = new Whitelist(this);
|
||||
|
||||
Reference in new issue
Block a user