Skip to content

Commit

Permalink
Merge pull request #68 from IhorKobylinskiy/fix-fullscreen-on-IPad
Browse files Browse the repository at this point in the history
fix isiOSDevice function for IPad
  • Loading branch information
IxquitilisSaid authored Aug 6, 2021
2 parents 3843233 + f1692fe commit 2d2fe4e
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,20 @@ export class VgUtilsService {

static isiOSDevice() {
return (
navigator.userAgent.match(/ip(hone|ad|od)/i) &&
(navigator.userAgent.match(/ip(hone|ad|od)/i) ||
VgUtilsService.isIpadOS()) &&
!navigator.userAgent.match(/(iemobile)[\/\s]?([\w\.]*)/i)
);
}

static isIpadOS() {
return (
navigator.maxTouchPoints &&
navigator.maxTouchPoints > 2 &&
/MacIntel/.test(navigator.platform)
);
}

static isCordova() {
return (
document.URL.indexOf('http://') === -1 &&
Expand Down

0 comments on commit 2d2fe4e

Please sign in to comment.