repo: janusweb action: commit revision: path_from: revision_from: f3fb5a125e913087fb9fcbc3af19cc7716a3b3c5: path_to: revision_to:
commit f3fb5a125e913087fb9fcbc3af19cc7716a3b3c5 Author: James BaicoianuDate: Sat May 1 23:25:23 2021 -0700 Disable AR button if no devices found diff --git a/media/assets/webui/apps/buttons/buttons.js b/media/assets/webui/apps/buttons/buttons.js
--- a/media/assets/webui/apps/buttons/buttons.js
+++ b/media/assets/webui/apps/buttons/buttons.js
@@ -143,12 +143,20 @@ elation.elements.define('janus-button-webar', class extends elation.elements.ui.
super.create();
this.view = janus.engine.client.view;
+ this.disabled = true;
if ('xr' in navigator) {
this.label = this.inactivelabel;
this.xr = true;
navigator.xr.isSessionSupported('immersive-ar').then(supported => {
this.enabled = supported;
+ if (supported) {
+ this.disabled = false;
+ } else {
+ this.title = 'WebXR supported, but no AR devices found';
+ }
});
+ } else {
+ this.title = 'WebXR is not supported in this browser';
}
}
onactivate(ev) {
-----END OF PAGE-----