@needle-tools/engine 5.1.0-alpha.6 → 5.1.0-canary.02ccb45

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.
Files changed (74) hide show
  1. package/CHANGELOG.md +3 -1
  2. package/components.needle.json +1 -1
  3. package/dist/{needle-engine.bundle-5avtTUMM.umd.cjs → needle-engine.bundle-BSJwg312.umd.cjs} +102 -102
  4. package/dist/{needle-engine.bundle-C0gPOq4m.js → needle-engine.bundle-DLNnLj9B.js} +1185 -1160
  5. package/dist/{needle-engine.bundle-BHcw4C8f.min.js → needle-engine.bundle-I8Lv85MA.min.js} +110 -110
  6. package/dist/needle-engine.d.ts +54 -38
  7. package/dist/needle-engine.js +405 -404
  8. package/dist/needle-engine.min.js +1 -1
  9. package/dist/needle-engine.umd.cjs +1 -1
  10. package/lib/engine/api.d.ts +1 -1
  11. package/lib/engine/api.js +1 -1
  12. package/lib/engine/api.js.map +1 -1
  13. package/lib/engine/engine_init.js +2 -2
  14. package/lib/engine/engine_init.js.map +1 -1
  15. package/lib/engine/engine_license.d.ts +7 -7
  16. package/lib/engine/engine_license.js +72 -72
  17. package/lib/engine/engine_license.js.map +1 -1
  18. package/lib/engine/engine_networking_blob.js +3 -3
  19. package/lib/engine/engine_networking_blob.js.map +1 -1
  20. package/lib/engine/engine_utils_format.js +20 -14
  21. package/lib/engine/engine_utils_format.js.map +1 -1
  22. package/lib/engine/engine_utils_qrcode.js +2 -2
  23. package/lib/engine/engine_utils_qrcode.js.map +1 -1
  24. package/lib/engine/webcomponents/needle menu/needle-menu-spatial.js +2 -2
  25. package/lib/engine/webcomponents/needle menu/needle-menu-spatial.js.map +1 -1
  26. package/lib/engine/webcomponents/needle menu/needle-menu.js +5 -5
  27. package/lib/engine/webcomponents/needle menu/needle-menu.js.map +1 -1
  28. package/lib/engine/webcomponents/needle-engine.js +2 -2
  29. package/lib/engine/webcomponents/needle-engine.js.map +1 -1
  30. package/lib/engine/webcomponents/needle-engine.loading.js +2 -2
  31. package/lib/engine/webcomponents/needle-engine.loading.js.map +1 -1
  32. package/lib/engine/xr/TempXRContext.js +2 -2
  33. package/lib/engine/xr/TempXRContext.js.map +1 -1
  34. package/lib/engine-components/AudioSource.js +1 -1
  35. package/lib/engine-components/AudioSource.js.map +1 -1
  36. package/lib/engine-components/DropListener.js +1 -0
  37. package/lib/engine-components/DropListener.js.map +1 -1
  38. package/lib/engine-components/OrbitControls.d.ts +1 -0
  39. package/lib/engine-components/OrbitControls.js +7 -2
  40. package/lib/engine-components/OrbitControls.js.map +1 -1
  41. package/lib/engine-components/VideoPlayer.d.ts +8 -2
  42. package/lib/engine-components/VideoPlayer.js +42 -19
  43. package/lib/engine-components/VideoPlayer.js.map +1 -1
  44. package/lib/engine-components/Voip.d.ts +16 -7
  45. package/lib/engine-components/Voip.js +90 -53
  46. package/lib/engine-components/Voip.js.map +1 -1
  47. package/lib/engine-components/api.d.ts +1 -0
  48. package/lib/engine-components/api.js +1 -0
  49. package/lib/engine-components/api.js.map +1 -1
  50. package/lib/engine-components/export/usdz/USDZExporter.js +4 -4
  51. package/lib/engine-components/export/usdz/USDZExporter.js.map +1 -1
  52. package/package.json +2 -2
  53. package/plugins/common/license.js +28 -6
  54. package/plugins/types/userconfig.d.ts +4 -1
  55. package/plugins/vite/build-pipeline.js +57 -20
  56. package/plugins/vite/license.js +4 -4
  57. package/src/engine/api.ts +1 -1
  58. package/src/engine/engine_init.ts +2 -2
  59. package/src/engine/engine_license.ts +69 -69
  60. package/src/engine/engine_networking_blob.ts +3 -3
  61. package/src/engine/engine_utils_format.ts +20 -14
  62. package/src/engine/engine_utils_qrcode.ts +2 -2
  63. package/src/engine/webcomponents/needle menu/needle-menu-spatial.ts +2 -2
  64. package/src/engine/webcomponents/needle menu/needle-menu.ts +5 -5
  65. package/src/engine/webcomponents/needle-engine.loading.ts +6 -6
  66. package/src/engine/webcomponents/needle-engine.ts +2 -2
  67. package/src/engine/xr/TempXRContext.ts +2 -2
  68. package/src/engine-components/AudioSource.ts +1 -1
  69. package/src/engine-components/DropListener.ts +1 -0
  70. package/src/engine-components/OrbitControls.ts +8 -2
  71. package/src/engine-components/VideoPlayer.ts +40 -17
  72. package/src/engine-components/Voip.ts +88 -53
  73. package/src/engine-components/api.ts +1 -0
  74. package/src/engine-components/export/usdz/USDZExporter.ts +4 -4
@@ -207,16 +207,13 @@ export class VideoPlayer extends Behaviour {
207
207
  */
208
208
  get isPlaying(): boolean {
209
209
  const video = this._videoElement;
210
- if (video) {
211
- if (video.currentTime > 0 && !video.paused && !video.ended
212
- && video.readyState > video.HAVE_CURRENT_DATA)
213
- return true;
214
- else if (video.srcObject) {
215
- const stream = video.srcObject as MediaStream;
216
- if (stream.active) return true;
217
- }
210
+ if (!video) return false;
211
+ if (video.paused || video.ended) return false;
212
+ if (video.srcObject) {
213
+ const stream = video.srcObject as MediaStream;
214
+ return stream.active;
218
215
  }
219
- return false;
216
+ return video.currentTime > 0 && video.readyState > video.HAVE_CURRENT_DATA;
220
217
  }
221
218
 
222
219
  get crossOrigin(): string | null {
@@ -430,26 +427,52 @@ export class VideoPlayer extends Behaviour {
430
427
 
431
428
  private _playErrors: number = 0;
432
429
 
433
- /** start playing the video source */
434
- play() {
430
+ /**
431
+ * Plays the assigned video clip, URL, or MediaStream.
432
+ * If a `clip` argument is passed, it is used as the new video source (mirroring {@link AudioSource.play}).
433
+ *
434
+ * @param clip - Optional video URL string or {@link MediaStream} to play. If omitted, plays the currently assigned source.
435
+ * @returns A promise that resolves to `true` when playback was successfully started, or `false` on error.
436
+ */
437
+ async play(clip?: string | MediaStream): Promise<boolean> {
438
+ // Defensive: if called from an event handler with a non-string/non-MediaStream argument
439
+ // (e.g. SpatialTrigger.onEnter passes a receiver object), ignore the arg and fall back to the assigned source.
440
+ // Same pattern as AudioSource.play.
441
+ if (clip !== undefined && typeof clip !== "string" && !(clip instanceof MediaStream)) {
442
+ if (isDevEnvironment()) console.warn("[VideoPlayer] Called play with unknown argument type. Using assigned source instead.", clip);
443
+ clip = undefined;
444
+ }
445
+
446
+ if (typeof clip === "string") {
447
+ this.setClipURL(clip);
448
+ }
449
+ else if (clip instanceof MediaStream) {
450
+ this.setVideo(clip);
451
+ }
452
+
435
453
  if (!this._videoElement) this.create(false);
436
454
  if (!this._videoElement) {
437
455
  if (debug) console.warn("Can not play: no video element found", this);
438
- return
456
+ return false;
439
457
  }
440
- if (this._isPlaying && !this._videoElement?.ended && !this._videoElement?.paused) return;
458
+ if (this._isPlaying && !this._videoElement?.ended && !this._videoElement?.paused) return true;
441
459
  this._isPlaying = true;
442
460
  if (!this._receivedInput) this._videoElement.muted = true;
443
461
  this.handleBeginPlaying(false);
444
462
 
445
463
  if (this.shouldUseM3U) {
446
464
  this.ensureM3UCanBePlayed();
447
- return;
465
+ return true;
448
466
  }
449
467
 
450
468
  if (debug) console.log("Video Play()", this.clip, this._videoElement, this.time);
451
469
  this._videoElement.currentTime = this.time;
452
- this._videoElement.play().catch(err => {
470
+ try {
471
+ await this._videoElement.play();
472
+ if (debug) console.log("play", this._videoElement, this.time);
473
+ return true;
474
+ }
475
+ catch (err: any) {
453
476
  if (this._playErrors++ < 10) console.error(err);
454
477
  else if (this._playErrors === 10) console.error("Multiple errors playing video, further errors will be suppressed. Use 'debugvideo' param to see all errors.");
455
478
  // https://developer.chrome.com/blog/play-request-was-interrupted/
@@ -459,8 +482,8 @@ export class VideoPlayer extends Behaviour {
459
482
  if (this._isPlaying && !this.destroyed && this.activeAndEnabled)
460
483
  this.play();
461
484
  }, 1000);
462
- });
463
- if (debug) console.log("play", this._videoElement, this.time);
485
+ return false;
486
+ }
464
487
  }
465
488
 
466
489
  /**
@@ -36,9 +36,9 @@ const debugParam = getParam("debugvoip");
36
36
  * voip.createMenuButton = true;
37
37
  *
38
38
  * // Manual control
39
- * voip.connect(); // Start sending audio
40
- * voip.disconnect(); // Stop sending
41
- * voip.setMuted(true); // Mute microphone
39
+ * voip.connect(); // Start sending your microphone
40
+ * voip.disconnect(); // Stop sending your microphone
41
+ * voip.setMuted(true); // Mute incoming audio (silence other users)
42
42
  * ```
43
43
  *
44
44
  * @summary Voice over IP for networked audio communication
@@ -84,9 +84,13 @@ export class Voip extends Behaviour {
84
84
  @serializable()
85
85
  get volume(): number { return this._volume; }
86
86
  set volume(val: number) {
87
- this._volume = val;
87
+ // HTMLMediaElement.volume throws IndexSizeError outside [0,1] — clamp before assigning.
88
+ // Reject NaN so we don't poison _volume and break serialization.
89
+ if (Number.isNaN(val)) return;
90
+ const clamped = Math.max(0, Math.min(1, val));
91
+ this._volume = clamped;
88
92
  for (const audio of this._incomingStreams.values()) {
89
- audio.volume = val;
93
+ audio.volume = clamped;
90
94
  }
91
95
  }
92
96
 
@@ -119,11 +123,11 @@ export class Voip extends Behaviour {
119
123
  }
120
124
 
121
125
  /**
122
- * Threshold for speaking detection (0–255). When a user's audio amplitude exceeds this,
123
- * they are considered "speaking". Default is 30.
126
+ * Normalized amplitude threshold for speaking detection (0–1). When a user's average
127
+ * audio amplitude exceeds this, they are considered "speaking". Default is 0.1.
124
128
  */
125
129
  @serializable()
126
- speakingThreshold: number = 30;
130
+ speakingThreshold: number = 0.1;
127
131
 
128
132
  /**
129
133
  * Event fired when a user's speaking state changes.
@@ -133,7 +137,11 @@ export class Voip extends Behaviour {
133
137
  onSpeakingChanged: EventList = new EventList();
134
138
 
135
139
  private _speakingStates = new Map<string, boolean>();
136
- private _analysers = new Map<string, { analyser: AnalyserNode, data: Uint8Array, context: AudioContext }>();
140
+ private _analysers = new Map<string, { source: MediaStreamAudioSourceNode, analyser: AnalyserNode, data: Uint8Array }>();
141
+ // Single shared AudioContext for all remote-user analysers. Browsers cap live AudioContexts at ~6 per tab,
142
+ // so one-per-user would break voice rooms of 7+ participants. Lazily created on first setupAnalyser.
143
+ private _sharedAudioContext?: AudioContext;
144
+ private _lastSpeakingPollMs = 0;
137
145
 
138
146
  private _net?: NetworkedStreams;
139
147
  private _menubutton?: HTMLElement;
@@ -142,12 +150,12 @@ export class Voip extends Behaviour {
142
150
  awake() {
143
151
  if (debugParam) this.debug = true;
144
152
  if (this.debug) {
145
- console.log("VOIP debugging: press 'v' to toggle mute or 'c' to toggle connect/disconnect");
153
+ console.log("VOIP debugging: press 'v' to toggle incoming mute, 'c' to toggle connect/disconnect");
146
154
  window.addEventListener("keydown", async (evt) => {
147
155
  const key = evt.key.toLowerCase();
148
156
  switch (key) {
149
157
  case "v":
150
- console.log("MUTE?", !this.isMuted)
158
+ console.log("VOIP: toggle incoming mute → ", !this.isMuted);
151
159
  this.setMuted(!this.isMuted);
152
160
  break;
153
161
  case "c":
@@ -156,15 +164,6 @@ export class Voip extends Behaviour {
156
164
  break;
157
165
  }
158
166
  });
159
- // mute unfocused
160
- window.addEventListener("blur", () => {
161
- console.log("VOIP: MUTE ON BLUR")
162
- this.setMuted(true);
163
- });
164
- window.addEventListener("focus", () => {
165
- console.log("VOIP: UNMUTE ON FOCUS")
166
- this.setMuted(false);
167
- });
168
167
  }
169
168
  }
170
169
 
@@ -201,10 +200,11 @@ export class Voip extends Behaviour {
201
200
  this.onEnabledChanged();
202
201
  this.updateButton();
203
202
  window.removeEventListener("visibilitychange", this.onVisibilityChanged);
204
- // Clean up analysers
203
+ // Clean up analysers and the shared AudioContext (lazily recreated on next setupAnalyser).
205
204
  for (const userId of [...this._analysers.keys()]) {
206
205
  this.cleanupAnalyser(userId);
207
206
  }
207
+ this.closeSharedAudioContext();
208
208
  }
209
209
 
210
210
  /** @internal */
@@ -215,6 +215,7 @@ export class Voip extends Behaviour {
215
215
  for (const userId of [...this._analysers.keys()]) {
216
216
  this.cleanupAnalyser(userId);
217
217
  }
218
+ this.closeSharedAudioContext();
218
219
  for (const incoming of this._incomingStreams.values()) {
219
220
  disposeStream(incoming.srcObject as MediaStream);
220
221
  }
@@ -225,6 +226,10 @@ export class Voip extends Behaviour {
225
226
  /** Set via the mic button (e.g. when the websocket connection closes and rejoins but the user was muted before we don't want to enable VOIP again automatically) */
226
227
  private _allowSending = true;
227
228
  private _outputStream: MediaStream | null = null;
229
+ // Tracks an in-flight connect() so concurrent callers coalesce onto the same promise
230
+ // instead of each running getUserMedia in parallel (which would leak a MediaStream and
231
+ // briefly transmit then kill the first acquired stream).
232
+ private _connectInFlight?: Promise<boolean>;
228
233
 
229
234
  /**
230
235
  * @returns true if the component is currently sending audio
@@ -233,7 +238,18 @@ export class Voip extends Behaviour {
233
238
 
234
239
 
235
240
  /** Start sending audio. */
236
- async connect(audioSource?: MediaTrackConstraints) {
241
+ connect(audioSource?: MediaTrackConstraints): Promise<boolean> {
242
+ // Coalesce concurrent callers. Without this, two near-simultaneous connect() calls
243
+ // each call getUserMedia in parallel, the first stream gets disposed mid-broadcast
244
+ // by the second, and a MediaStream leaks.
245
+ if (this._connectInFlight) return this._connectInFlight;
246
+ this._connectInFlight = this._connectImpl(audioSource).finally(() => {
247
+ this._connectInFlight = undefined;
248
+ });
249
+ return this._connectInFlight;
250
+ }
251
+
252
+ private async _connectImpl(audioSource?: MediaTrackConstraints): Promise<boolean> {
237
253
  if (!this._net) {
238
254
  console.error("Cannot connect to voice chat - NetworkedStreams not initialized. Make sure the component is enabled before calling this method.");
239
255
  return false;
@@ -281,27 +297,25 @@ export class Voip extends Behaviour {
281
297
  }
282
298
 
283
299
  /**
284
- * Mute or unmute the audio stream (this will only mute incoming streams and not mute your own microphone. Use disconnect() to mute your own microphone)
300
+ * Mute or unmute the audio you hear from other users (incoming streams).
301
+ * This does NOT mute your own microphone — use {@link disconnect} to stop sending your microphone.
285
302
  */
286
303
  setMuted(mute: boolean) {
287
- const audio = this._outputStream?.getAudioTracks();
288
- if (audio) {
289
- for (const track of audio) {
290
- track.enabled = !mute
291
- }
304
+ for (const audio of this._incomingStreams.values()) {
305
+ audio.muted = mute;
292
306
  }
293
307
  }
294
308
 
295
- /** Returns true if the audio stream is currently muted */
309
+ /**
310
+ * Returns true if incoming audio is currently muted (you can't hear other users).
311
+ * When there are no incoming streams, returns false.
312
+ */
296
313
  get isMuted() {
297
- if (this._outputStream === null) return false;
298
- const audio = this._outputStream?.getAudioTracks();
299
- if (audio) {
300
- for (const track of audio) {
301
- if (!track.enabled) return true;
302
- }
314
+ if (this._incomingStreams.size === 0) return false;
315
+ for (const audio of this._incomingStreams.values()) {
316
+ if (!audio.muted) return false;
303
317
  }
304
- return false;
318
+ return true;
305
319
  }
306
320
 
307
321
  private async updateButton() {
@@ -381,7 +395,7 @@ export class Voip extends Behaviour {
381
395
  .catch((err) => {
382
396
  console.warn("VOIP failed getting audio stream", err);
383
397
  return null;
384
- });;
398
+ });
385
399
  }
386
400
 
387
401
  const stream = await getUserMedia(audio);
@@ -397,7 +411,13 @@ export class Voip extends Behaviour {
397
411
  if (nonBuiltInAudioSource) {
398
412
  const constraints = Object.assign({}, audio);
399
413
  constraints.deviceId = nonBuiltInAudioSource.deviceId;
400
- return await getUserMedia(constraints);
414
+ const externalStream = await getUserMedia(constraints);
415
+ if (externalStream) {
416
+ // Release the built-in mic stream we grabbed first — otherwise its tracks stay live.
417
+ disposeStream(stream);
418
+ return externalStream;
419
+ }
420
+ // External device acquisition failed — keep the original stream rather than returning null.
401
421
  }
402
422
  }
403
423
 
@@ -431,20 +451,25 @@ export class Voip extends Behaviour {
431
451
  update() {
432
452
  // Only run speaking detection if someone is listening
433
453
  if (!this.onSpeakingChanged || this.onSpeakingChanged.listenerCount <= 0) return;
454
+ // Rate-limit analysis to ~10Hz. Speaking-state is a coarse UI signal; running FFT per
455
+ // remote user every frame (60Hz) is wasteful and scales linearly with participant count.
456
+ const now = performance.now();
457
+ if (now - this._lastSpeakingPollMs < 100) return;
458
+ this._lastSpeakingPollMs = now;
434
459
 
435
460
  for (const [userId, info] of this._analysers) {
436
461
  info.analyser.getByteFrequencyData(info.data as Uint8Array<ArrayBuffer>);
437
- // Average amplitude
462
+ // Average amplitude normalized to 0–1
438
463
  let sum = 0;
439
464
  for (let i = 0; i < info.data.length; i++) sum += info.data[i];
440
- const avg = sum / info.data.length;
465
+ const volume = sum / info.data.length / 255;
441
466
 
442
467
  const wasSpeaking = this._speakingStates.get(userId) ?? false;
443
- const isSpeaking = avg > this.speakingThreshold;
468
+ const isSpeaking = volume > this.speakingThreshold;
444
469
 
445
470
  if (isSpeaking !== wasSpeaking) {
446
471
  this._speakingStates.set(userId, isSpeaking);
447
- this.onSpeakingChanged.invoke({ userId, isSpeaking, volume: avg / 255 });
472
+ this.onSpeakingChanged.invoke({ userId, isSpeaking, volume });
448
473
  }
449
474
  }
450
475
  }
@@ -453,13 +478,16 @@ export class Voip extends Behaviour {
453
478
  // Only set up if someone is listening or might listen
454
479
  if (this._analysers.has(userId)) return;
455
480
  try {
456
- const audioCtx = new AudioContext();
457
- const source = audioCtx.createMediaStreamSource(stream);
458
- const analyser = audioCtx.createAnalyser();
481
+ if (!this._sharedAudioContext) {
482
+ this._sharedAudioContext = new AudioContext();
483
+ }
484
+ const ctx = this._sharedAudioContext;
485
+ const source = ctx.createMediaStreamSource(stream);
486
+ const analyser = ctx.createAnalyser();
459
487
  analyser.fftSize = 256;
460
488
  source.connect(analyser);
461
489
  const data = new Uint8Array(analyser.frequencyBinCount);
462
- this._analysers.set(userId, { analyser, data, context: audioCtx });
490
+ this._analysers.set(userId, { source, analyser, data });
463
491
  }
464
492
  catch (err) {
465
493
  if (this.debug) console.warn("VOIP: Failed to create analyser for", userId, err);
@@ -469,12 +497,20 @@ export class Voip extends Behaviour {
469
497
  private cleanupAnalyser(userId: string) {
470
498
  const info = this._analysers.get(userId);
471
499
  if (info) {
472
- info.context.close();
500
+ info.source.disconnect();
501
+ info.analyser.disconnect();
473
502
  this._analysers.delete(userId);
474
503
  }
475
504
  this._speakingStates.delete(userId);
476
505
  }
477
506
 
507
+ private closeSharedAudioContext() {
508
+ if (this._sharedAudioContext) {
509
+ this._sharedAudioContext.close();
510
+ this._sharedAudioContext = undefined;
511
+ }
512
+ }
513
+
478
514
  private onReceiveStream = (evt: StreamReceivedEvent) => {
479
515
  const userId = evt.target.userId;
480
516
  const stream = evt.stream;
@@ -512,12 +548,11 @@ export class Voip extends Behaviour {
512
548
 
513
549
  private onVisibilityChanged = () => {
514
550
  if (this.runInBackground) return;
515
- const visible = document.visibilityState === "visible";
516
- const muted = !visible;
551
+ const muted = document.visibilityState !== "visible";
552
+ // Mute incoming so we don't hear other users while tab is hidden.
517
553
  this.setMuted(muted);
518
- for (const element of this._incomingStreams) {
519
- const str = element[1];
520
- str.muted = muted;
521
- }
554
+ // Also disable our outgoing mic tracks (cheaper than disconnect/reconnect — keeps the mic permission).
555
+ const tracks = this._outputStream?.getAudioTracks();
556
+ if (tracks) for (const t of tracks) t.enabled = !muted;
522
557
  };
523
558
  }
@@ -41,6 +41,7 @@ export { Collider } from "./Collider.js"; // export abstract type
41
41
  export { Behaviour, Component, GameObject } from "./Component.js";
42
42
 
43
43
  // We dont want to export everything in the extensions
44
+ export { AudioRolloffMode } from "./AudioSource.js";
44
45
  export { ClearFlags } from "./Camera.js"
45
46
  export { DragMode } from "./DragControls.js";
46
47
  export type { DropListenerNetworkEventArguments, DropListenerOnDropArguments } from "./DropListener.js";
@@ -3,7 +3,7 @@ import { Euler, Material, Matrix4, Mesh, Object3D, Quaternion, Vector3 } from "t
3
3
 
4
4
  import { isDevEnvironment, showBalloonMessage, showBalloonWarning } from "../../../engine/debug/index.js";
5
5
  import { findObjectOfType } from "../../../engine/engine_components.js";
6
- import { _cxKhKwDL } from "../../../engine/engine_license.js";
6
+ import { UsFaeEU } from "../../../engine/engine_license.js";
7
7
  import { serializable } from "../../../engine/engine_serialization.js";
8
8
  import { getFormattedDate, Progress } from "../../../engine/engine_time_utils.js";
9
9
  import { DeviceUtilities, getParam } from "../../../engine/engine_utils.js";
@@ -277,7 +277,7 @@ export class USDZExporter extends Behaviour {
277
277
  let name = this.exportFileName ?? this.objectToExport?.name ?? this.name;
278
278
  name += "-" + getFormattedDate(); // seems iOS caches the file in some cases, this ensures we always have a fresh file
279
279
 
280
- if (!_cxKhKwDL()) {
280
+ if (!UsFaeEU()) {
281
281
  if (name !== "") name += "-";
282
282
  name += "MadeWithNeedle";
283
283
  }
@@ -682,7 +682,7 @@ export class USDZExporter extends Behaviour {
682
682
  if (debug)
683
683
  showBalloonMessage("Quicklook url: " + callToActionURL);
684
684
  if (callToActionURL) {
685
- if (!_cxKhKwDL()) {
685
+ if (!UsFaeEU()) {
686
686
  console.warn("Quicklook closed: custom redirects require a Needle Engine Pro license: https://needle.tools/pricing", callToActionURL)
687
687
  }
688
688
  else {
@@ -697,7 +697,7 @@ export class USDZExporter extends Behaviour {
697
697
  private buildQuicklookOverlay(): CustomBranding {
698
698
  const obj: CustomBranding = {};
699
699
  if (this.customBranding) Object.assign(obj, this.customBranding);
700
- if (!_cxKhKwDL()) {
700
+ if (!UsFaeEU()) {
701
701
  console.log("Custom Quicklook banner text requires pro license: https://needle.tools/pricing");
702
702
  obj.callToAction = "Close";
703
703
  obj.checkoutTitle = "🌵 Made with Needle";