Model-viewer: Is it possible to launch Scene Viewer offline (e.g., from a PWA)?

Created on 6 Jan 2020  路  4Comments  路  Source: google/model-viewer

I'm prototyping an app for a client and a requirement of it is to be installable and work offline. Using model-viewer with WebXR (behind 'unstable-webxr' attribute) runs nicely offline as PWA, but I'm considering Scene Viewer as a first option instead. So whenever the intent is issued to com.google.ar.core, the following dialog shows up:

Screenshot_20200105-202142_Google

Is there a way to circumvent that and use Scene Viewer in my offline app? I know this is not directly related to model-viewer.. Anyways, thanks for your great work guys!

not model-viewer question

All 4 comments

@tiagovignatti that's very cool to hear that you are using <model-viewer> in an offline-capable PWA. I hope you will share your work with us when you are done (if it is possible) 馃憤 we love hearing about that kind of thing.

Unfortunately, I am not aware of a good strategy for using Scene Viewer offline today. The same goes for Quick Look. It would be cool if you could somehow create an object URL and share that with these external viewers, but AFAIK it is not possible to do this.

/cc @tpsiaki in case he has any insight into this topic that can be shared.

@cdata @tpsiaki I've modified Hello Sceneform app to allow the AR activity receive an intent. With this app pre-installed in my Android device I was able to run my model-viewer based PWA offline and deep link the intent directly to the Hello Sceneform app AR activity. The Hello Sceneform app now would behave like my "own Scene Viewer" and therefore everything could be ran offline :raised_hands:

I didn't proceed further on this experiment to actually send the .glTF file from PWA to the native app but I don't think this would be a problem - it would be "just" a matter of saving the model locally (using Native File System API) and then deep linking the data through intent using the content: scheme. Maybe there's a simpler way.

Anyways, it was a cool experiment to show that it's possible to use PWA + native ARCore stuff offline. It's a real case problem that I'm still knocking my head to solve on my side but for now I'll do it using only the ARCore native infrastructure (i.e. without model-viewer unfortunately). I hope this maybe could also motivate the Scene Viewer folks to purse a solution that could work out offline.

@tiagovignatti that is really cool. Can you explain how your homemade viewer works offline? Does it cache models the first time it loads them? Or are you able to warm the cache somehow?

@tiagovignatti I shared your feedback with the Scene Viewer team. I cannot promise anything, but it sounds like offline capability is something they are interested in.

Was this page helpful?
0 / 5 - 0 ratings