I would like to develop an application with AR.
That AR model contains a secret data, so I would like to prevent to download.
My app’s flow is following.
Firstly, I create usdz data through Playcanvas.
CreateExportUsdz.prototype.exportUsdz = function(){
const _entity = this.app.root.findByTag("AR")
const _option = {
maxTextureSize: 1024
}
//
const _usdzExporter = new pc.UsdzExporter()
_usdzExporter.build(_entity[0], _option).then((arrayBuffer) =>{
const _blob = new Blob([arrayBuffer], {type: "model/vnd.usdz+zip",})
const _url = URL.createObjectURL(_blob)
const a = document.createElement("a");
a.setAttribute("rel", "ar");
a.setAttribute("href", _url);
a.style.display = "none";
document.body.appendChild(a)
a.click();
a.remove();
setTimeout(() => URL.revokeObjectURL(_url), 10000);
}).catch(console.error)
}
Secondly, I convert it BLOB format.
Lastly, I pass it to Html.
AR view is succeeded.
Unfortunately, we could download from red marked UI. (Save as File)
I would like to prevent it.
If someone has answer, could you tell me it?
