ohzi-core 10.6.7 → 10.6.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ohzi-core",
3
- "version": "10.6.7",
3
+ "version": "10.6.9",
4
4
  "description": "OHZI Core Library",
5
5
  "source": "src/index.js",
6
6
  "module": "build/index.module.js",
@@ -16,8 +16,7 @@
16
16
  "preinstall": "yarn config-hooks",
17
17
  "config-hooks": "git config core.hooksPath git_hooks",
18
18
  "build": "rollup -c",
19
- "create-tag": "cross-var git tag -a \"v$npm_package_version\" -m \"Release Version $npm_package_version\" && cross-var git push origin \"v$npm_package_version\"",
20
- "update-version": "cross-var echo \"v$npm_package_version\" > .version",
19
+ "create-tag": "node tasks/app/create_tag.mjs",
21
20
  "fix-syntax": "standardx --fix",
22
21
  "generate-types": "npx -p typescript tsc src/* --declaration --allowJs --emitDeclarationOnly --outDir types",
23
22
  "upload": "yarn build && npm publish && yarn create-tag",
@@ -52,7 +51,6 @@
52
51
  ]
53
52
  },
54
53
  "devDependencies": {
55
- "cross-var": "^1.1.0",
56
54
  "rollup": "^2.44.0",
57
55
  "rollup-plugin-glslify": "^1.2.0",
58
56
  "rollup-plugin-sourcemaps": "^0.6.3",
package/src/Browser.js CHANGED
@@ -1,22 +1,16 @@
1
1
 
2
2
  class Browser
3
3
  {
4
- init()
4
+ async init()
5
5
  {
6
6
  this.browser_name = '';
7
7
  this.agent = window.navigator.userAgent.toLowerCase();
8
8
 
9
- // vr specific
10
- this.vr_browser_keywords = ['oculusbrowser', 'oculus', 'vive', 'rift', 'windowsmr', 'cardboard', 'daydream', 'wolvic'];
11
- this.vr_browser_name = this.vr_browser_keywords.find(keyword => this.agent.includes(keyword));
12
- // Check for WebXR support (indicating VR capabilities)
13
9
  this.has_web_xr_support = 'xr' in navigator;
10
+ this.is_vr = this.has_web_xr_support && await navigator.xr.isSessionSupported('immersive-vr');
14
11
 
15
12
  switch (true)
16
13
  {
17
- case this.vr_browser_name !== undefined && this.has_web_xr_support:
18
- this.browser_name = this.vr_browser_name;
19
- break;
20
14
  case this.agent.indexOf('edge') > -1:
21
15
  this.browser_name = 'edge_ie';
22
16
  break;
@@ -71,11 +65,6 @@ class Browser
71
65
  return this.browser_name === 'edge_chromium';
72
66
  }
73
67
 
74
- get is_vr()
75
- {
76
- return this.vr_browser_keywords.includes(this.browser_name);
77
- }
78
-
79
68
  get has_webm()
80
69
  {
81
70
  return !!(this.is_chrome || this.is_firefox || this.is_edge_chromium);