Skip to content

How to read blob uri? #847

Answered by donmccurdy
neciszhang asked this question in Q&A
Discussion options

You must be logged in to vote

Is this a .glb file? If you have a File instance already, then accessing it through an ArrayBuffer and parsing that might be the way to go:

const arrayBuffer = await file.arrayBuffer();
const { json, resources } = io.binaryToJSON(arrayBuffer);

If it's a .gltf and already in local memory, then you'll have to construct the JSONDocument yourself in order to parse that. Relative references to textures and .bin files will not work when encoding a blob URI.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@neciszhang
Comment options

Answer selected by neciszhang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants