mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-25 16:11:20 -08:00
remove isMobile from instance
This commit is contained in:
1 parent
6b19316bf3
commit
7d06600d7b
10 files changed
+23
-102
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { append, clamp, tooltip, setStyle } from '../utils';
|
||||
import { append, clamp, tooltip, setStyle, isMobile } from '../utils';
|
||||
|
||||
export default function volume(option) {
|
||||
return (art) => ({
|
||||
@@ -21,7 +21,7 @@ export default function volume(option) {
|
||||
tooltip($volume, i18n.get('Mute'));
|
||||
setStyle($volumeClose, 'display', 'none');
|
||||
|
||||
if (art.isMobile) {
|
||||
if (isMobile) {
|
||||
setStyle($volumePanel, 'display', 'none');
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { clamp, secondToTime } from '../utils';
|
||||
import { clamp, secondToTime, isMobile } from '../utils';
|
||||
|
||||
export default function gestureInit(art, events) {
|
||||
if (art.isMobile && !art.option.isLive) {
|
||||
if (isMobile && !art.option.isLive) {
|
||||
const {
|
||||
player,
|
||||
notice,
|
||||
|
||||
@@ -173,26 +173,6 @@ export default class Artplayer extends Emitter {
|
||||
};
|
||||
}
|
||||
|
||||
get userAgent() {
|
||||
return utils.userAgent;
|
||||
}
|
||||
|
||||
get isMobile() {
|
||||
return utils.isMobile;
|
||||
}
|
||||
|
||||
get isWechat() {
|
||||
return utils.isWechat;
|
||||
}
|
||||
|
||||
get isSafari() {
|
||||
return utils.isSafari;
|
||||
}
|
||||
|
||||
get isIE() {
|
||||
return utils.isIE;
|
||||
}
|
||||
|
||||
get proxy() {
|
||||
return this.events.proxy;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import config from '../config';
|
||||
import { sleep, addClass, setStyle } from '../utils';
|
||||
import { sleep, addClass, setStyle, isMobile } from '../utils';
|
||||
|
||||
export default function eventInit(art, player) {
|
||||
const {
|
||||
@@ -96,7 +96,7 @@ export default function eventInit(art, player) {
|
||||
|
||||
art.once('video:loadedmetadata', () => {
|
||||
player.autoSize = option.autoSize;
|
||||
if (art.isMobile) {
|
||||
if (isMobile) {
|
||||
art.loading.show = false;
|
||||
art.controls.show = true;
|
||||
art.mask.show = true;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { errorHandle, query, addClass, replaceElement } from './utils';
|
||||
import { errorHandle, query, addClass, replaceElement, isMobile } from './utils';
|
||||
|
||||
export default class Template {
|
||||
constructor(art) {
|
||||
@@ -144,7 +144,7 @@ export default class Template {
|
||||
addClass(this.$info, 'art-backdrop-filter');
|
||||
}
|
||||
|
||||
if (this.art.isMobile) {
|
||||
if (isMobile) {
|
||||
addClass(this.$container, 'art-mobile');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { userAgent, isMobile } from './utils';
|
||||
|
||||
export default class Whitelist {
|
||||
constructor(art) {
|
||||
const {
|
||||
@@ -5,15 +7,15 @@ export default class Whitelist {
|
||||
option: { whitelist },
|
||||
} = art;
|
||||
this.state =
|
||||
!art.isMobile ||
|
||||
!isMobile ||
|
||||
whitelist.some((item) => {
|
||||
switch (kindOf(item)) {
|
||||
case 'string':
|
||||
return item === '*' || art.userAgent.indexOf(item) > -1;
|
||||
return item === '*' || userAgent.indexOf(item) > -1;
|
||||
case 'function':
|
||||
return item(art.userAgent);
|
||||
return item(userAgent);
|
||||
case 'regexp':
|
||||
return item.test(art.userAgent);
|
||||
return item.test(userAgent);
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user