mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-28 02:01: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,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