diff options
author | Chocobozzz <me@florianbigard.com> | 2022-03-14 14:28:20 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-03-14 14:36:35 +0100 |
commit | 57d6503286b114fee61b5e4725825e2490dcac29 (patch) | |
tree | 2d3d23f697b2986d7e41bb443754394296b66ec3 /client/src/root-helpers/web-browser.ts | |
parent | 9597920ee3d4ac99803e7107983ddf98a9dfb3c4 (diff) | |
download | PeerTube-57d6503286b114fee61b5e4725825e2490dcac29.tar.gz PeerTube-57d6503286b114fee61b5e4725825e2490dcac29.tar.zst PeerTube-57d6503286b114fee61b5e4725825e2490dcac29.zip |
Reorganize player files
Diffstat (limited to 'client/src/root-helpers/web-browser.ts')
-rw-r--r-- | client/src/root-helpers/web-browser.ts | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/client/src/root-helpers/web-browser.ts b/client/src/root-helpers/web-browser.ts new file mode 100644 index 000000000..9dade20e8 --- /dev/null +++ b/client/src/root-helpers/web-browser.ts | |||
@@ -0,0 +1,24 @@ | |||
1 | function isIOS () { | ||
2 | if (/iPad|iPhone|iPod/.test(navigator.platform)) { | ||
3 | return true | ||
4 | } | ||
5 | |||
6 | // Detect iPad Desktop mode | ||
7 | return !!(navigator.maxTouchPoints && | ||
8 | navigator.maxTouchPoints > 2 && | ||
9 | navigator.platform.includes('MacIntel')) | ||
10 | } | ||
11 | |||
12 | function isSafari () { | ||
13 | return /^((?!chrome|android).)*safari/i.test(navigator.userAgent) | ||
14 | } | ||
15 | |||
16 | function isMobile () { | ||
17 | return /iPhone|iPad|iPod|Android/i.test(navigator.userAgent) | ||
18 | } | ||
19 | |||
20 | export { | ||
21 | isIOS, | ||
22 | isSafari, | ||
23 | isMobile | ||
24 | } | ||