Model: Basic Blob URL test overriding type


HTML

<model alt="A model of a teapot" data-src="./teapot.usdz" data-type="model/vnd.usdz+zip">
</model>
    

JavaScript

const model = document.querySelector('model');
const {src, type} = model.dataset;
const bytes = await (await fetch(src)).bytes();
const srcString = URL.createObjectURL(new Blob([bytes], {type}));
model.setAttribute('src', srcString);
An image of a model of a teapot