diff --git a/src/loaders/Utils.js b/src/loaders/Utils.js index 4d446d7e..ca8c5076 100644 --- a/src/loaders/Utils.js +++ b/src/loaders/Utils.js @@ -1,6 +1,12 @@ import { SceneFormat } from './SceneFormat.js'; export const sceneFormatFromPath = (path) => { + try { + const url = new URL(path); + path = url.pathname; + } catch (e) { + // Ignore error, path is not a URL + } if (path.endsWith('.ply')) return SceneFormat.Ply; else if (path.endsWith('.splat')) return SceneFormat.Splat; else if (path.endsWith('.ksplat')) return SceneFormat.KSplat;