1 | import { settings, isMobile } from "@pixi/settings";
|
2 | function maxRecommendedTextures(max) {
|
3 | let allowMax = !0;
|
4 | const navigator = settings.ADAPTER.getNavigator();
|
5 | if (isMobile.tablet || isMobile.phone) {
|
6 | if (isMobile.apple.device) {
|
7 | const match = navigator.userAgent.match(/OS (\d+)_(\d+)?/);
|
8 | match && parseInt(match[1], 10) < 11 && (allowMax = !1);
|
9 | }
|
10 | if (isMobile.android.device) {
|
11 | const match = navigator.userAgent.match(/Android\s([0-9.]*)/);
|
12 | match && parseInt(match[1], 10) < 7 && (allowMax = !1);
|
13 | }
|
14 | }
|
15 | return allowMax ? max : 4;
|
16 | }
|
17 | export {
|
18 | maxRecommendedTextures
|
19 | };
|
20 |
|