@galihru/orbinexsim 0.1.17 → 0.1.18

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.
@@ -147,6 +147,9 @@ async function requestGeolocationPermission() {
147
147
  });
148
148
  }
149
149
  async function requestMotionSensorPermission() {
150
+ if (!window.isSecureContext) {
151
+ return "unsupported";
152
+ }
150
153
  const motionApi = window.DeviceMotionEvent;
151
154
  if (!motionApi || typeof motionApi.requestPermission !== "function") {
152
155
  return "unsupported";
@@ -11,7 +11,7 @@ import {
11
11
  resolveArMarkerHint,
12
12
  resolveCatalogProxyUrl,
13
13
  resolveObjectNameForMarker
14
- } from "./chunk-JF7PGQOV.js";
14
+ } from "./chunk-3FTZGG4E.js";
15
15
  export {
16
16
  bindMarkerTracking,
17
17
  createDefaultArMarkers,
@@ -112,6 +112,9 @@ async function requestGeolocationPermission() {
112
112
  });
113
113
  }
114
114
  async function requestMotionSensorPermission() {
115
+ if (!window.isSecureContext) {
116
+ return "unsupported";
117
+ }
115
118
  const motionApi = window.DeviceMotionEvent;
116
119
  if (!motionApi || typeof motionApi.requestPermission !== "function") {
117
120
  return "unsupported";
package/dist/index.cjs CHANGED
@@ -155,6 +155,9 @@ async function requestGeolocationPermission() {
155
155
  });
156
156
  }
157
157
  async function requestMotionSensorPermission() {
158
+ if (!window.isSecureContext) {
159
+ return "unsupported";
160
+ }
158
161
  const motionApi = window.DeviceMotionEvent;
159
162
  if (!motionApi || typeof motionApi.requestPermission !== "function") {
160
163
  return "unsupported";
@@ -521,7 +524,7 @@ async function requestRuntimePermissions(options = {}) {
521
524
  // src/index.ts
522
525
  var DEFAULT_BASE_URL = "https://galihru.github.io/OrbinexSimulation/";
523
526
  async function requestCameraPermission2() {
524
- if (!navigator.mediaDevices || typeof navigator.mediaDevices.getUserMedia !== "function") {
527
+ if (!window.isSecureContext || !navigator.mediaDevices || typeof navigator.mediaDevices.getUserMedia !== "function") {
525
528
  return "unsupported";
526
529
  }
527
530
  try {
@@ -538,7 +541,7 @@ async function requestCameraPermission2() {
538
541
  }
539
542
  }
540
543
  async function requestMicrophonePermission2() {
541
- if (!navigator.mediaDevices || typeof navigator.mediaDevices.getUserMedia !== "function") {
544
+ if (!window.isSecureContext || !navigator.mediaDevices || typeof navigator.mediaDevices.getUserMedia !== "function") {
542
545
  return "unsupported";
543
546
  }
544
547
  try {
@@ -566,6 +569,9 @@ async function requestGeolocationPermission2() {
566
569
  });
567
570
  }
568
571
  async function requestMotionSensorPermission2() {
572
+ if (!window.isSecureContext) {
573
+ return "unsupported";
574
+ }
569
575
  const motionApi = window.DeviceMotionEvent;
570
576
  if (!motionApi || typeof motionApi.requestPermission !== "function") {
571
577
  return "unsupported";
package/dist/index.js CHANGED
@@ -11,13 +11,13 @@ import {
11
11
  resolveArMarkerHint,
12
12
  resolveCatalogProxyUrl,
13
13
  resolveObjectNameForMarker
14
- } from "./chunk-JF7PGQOV.js";
14
+ } from "./chunk-3FTZGG4E.js";
15
15
 
16
16
  // src/index.ts
17
17
  import { constants, createOrbitSample } from "@galihru/orbinex";
18
18
  var DEFAULT_BASE_URL = "https://galihru.github.io/OrbinexSimulation/";
19
19
  async function requestCameraPermission() {
20
- if (!navigator.mediaDevices || typeof navigator.mediaDevices.getUserMedia !== "function") {
20
+ if (!window.isSecureContext || !navigator.mediaDevices || typeof navigator.mediaDevices.getUserMedia !== "function") {
21
21
  return "unsupported";
22
22
  }
23
23
  try {
@@ -34,7 +34,7 @@ async function requestCameraPermission() {
34
34
  }
35
35
  }
36
36
  async function requestMicrophonePermission() {
37
- if (!navigator.mediaDevices || typeof navigator.mediaDevices.getUserMedia !== "function") {
37
+ if (!window.isSecureContext || !navigator.mediaDevices || typeof navigator.mediaDevices.getUserMedia !== "function") {
38
38
  return "unsupported";
39
39
  }
40
40
  try {
@@ -62,6 +62,9 @@ async function requestGeolocationPermission() {
62
62
  });
63
63
  }
64
64
  async function requestMotionSensorPermission() {
65
+ if (!window.isSecureContext) {
66
+ return "unsupported";
67
+ }
65
68
  const motionApi = window.DeviceMotionEvent;
66
69
  if (!motionApi || typeof motionApi.requestPermission !== "function") {
67
70
  return "unsupported";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galihru/orbinexsim",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "description": "High-level Orbinex simulation + AR wrapper with one-call setup.",
5
5
  "type": "module",
6
6
  "license": "MIT",