mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 17:01:20 -08:00
add isSafari util
This commit is contained in:
1 parent
5f5461eeb4
commit
be060e48c4
9 files changed
+37
-14
No files matched your search
@@ -1,14 +1,16 @@
|
||||
import { isMobile, userAgent } from './utils/compatibility';
|
||||
|
||||
export default class Whitelist {
|
||||
constructor(art) {
|
||||
const {
|
||||
constructor: { kindOf },
|
||||
option: { whitelist },
|
||||
} = art;
|
||||
this.ua = navigator.userAgent;
|
||||
this.isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(this.ua);
|
||||
this.ua = userAgent;
|
||||
this.isMobile = isMobile();
|
||||
this.state =
|
||||
!this.isMobile ||
|
||||
whitelist.some(item => {
|
||||
whitelist.some((item) => {
|
||||
switch (kindOf(item)) {
|
||||
case 'string':
|
||||
return this.ua.indexOf(item) > -1;
|
||||
|
||||
Reference in new issue
Block a user