@playcanvas/supersplat-viewer 1.32.0 → 1.33.0

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": "@playcanvas/supersplat-viewer",
3
- "version": "1.32.0",
3
+ "version": "1.33.0",
4
4
  "author": "PlayCanvas <support@playcanvas.com>",
5
5
  "homepage": "https://github.com/playcanvas/supersplat-viewer#readme",
6
6
  "description": "Viewer for https://superspl.at",
package/public/index.html CHANGED
@@ -66,6 +66,13 @@
66
66
  const budgetParam = url.searchParams.get('budget');
67
67
  const budget = budgetParam !== null ? Number(budgetParam) : undefined;
68
68
 
69
+ // The engine's octree parser fetches lod-meta.json itself and ignores a prefetched
70
+ // response, so starting one here would download the metadata twice. Every other splat
71
+ // parser consumes it, so they keep the head start. `isPrefetchable` in src/index.ts
72
+ // applies the same rule for embedders that do not pass `contents`.
73
+ const contentName = contentFilename ?? new URL(contentUrl, location.href).pathname.split('/').pop() ?? '';
74
+ const prefetchContent = contentName.toLowerCase() !== 'lod-meta.json';
75
+
69
76
  // createViewer's options, minus the container and the settings. The poster image and
70
77
  // the content fetch start here, before the module bundle has arrived.
71
78
  const sseOptions = {
@@ -75,7 +82,7 @@
75
82
  skyboxUrl,
76
83
  collisionUrl,
77
84
  poster: posterUrl && createImage(posterUrl),
78
- contents: fetch(contentUrl),
85
+ contents: prefetchContent ? fetch(contentUrl) : undefined,
79
86
  ui: !url.searchParams.has('noui'),
80
87
  reticle: url.searchParams.has('reticle'),
81
88
  noanim: url.searchParams.has('noanim'),