API to get the state of the viewer #1916
Replies: 5 comments
-
Yes, you'll want to look at the events we expose which are toward the bottom of https://modelviewer.dev/. If there are any you feel are missing, please request them here. |
Beta Was this translation helpful? Give feedback.
-
Brilliant, was missing this part of the docs. I feel an |
Beta Was this translation helpful? Give feedback.
-
I'd recommend reading up on custom elements and lit-element, as that's what we're build on. I believe they already incorporate that functionality. For instance, you can use this CSS to hide child elements before the custom element loads.
|
Beta Was this translation helpful? Give feedback.
-
The CSS based approach is indeed interesting! If I understand the custom elements specs / lit-element docs correctly their lifecycle (in case of initialisation something like |
Beta Was this translation helpful? Give feedback.
-
I found the following at https://developers.google.com/web/fundamentals/web-components/customelements
|
Beta Was this translation helpful? Give feedback.
-
Does the current API provide a way to react to the viewer's state like "loading", "ready", "not supported" etc.?
Use cases are displaying custom loading and error messages and providing custom fallbacks.
Beta Was this translation helpful? Give feedback.
All reactions