@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/dist/index.js +2 -2
- package/dist/viewer.js +368 -99
- package/dist/viewer.js.map +1 -1
- package/package.json +1 -1
- package/public/index.html +8 -1
- package/public/index.js +368 -99
- package/public/index.js.map +1 -1
package/package.json
CHANGED
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'),
|