Hubs-Foundation / hubs

Duck-themed multi-user virtual spaces in WebVR. Built with A-Frame.
https://hubsfoundation.org
Mozilla Public License 2.0
2.13k stars 1.41k forks source link

Default Material Quality on Mobile #6193

Open mikemorran opened 1 year ago

mikemorran commented 1 year ago

Description Users are reporting that mobile material quality is not defaulting to "low" as expected. This feature is important to allow out mobile users to join Hubs rooms quickly. Unfortunately, the beginning of the line 23 conditional, window.AFRAME, is returning undefined when tested, meaning that this function does not appear to be able to detect whether a user is on mobile and default the correct setting.

To Reproduce Steps to reproduce the behavior:

  1. Enter any hubs room with breakpoint set on src/storage/store.js line 23. If you have joined Hubs on your browser before, make sure you are using a private/incognito version of your browser.

Expected behavior Line 23 should be able to properly detect if the user is on mobile.

Hardware

takahirox commented 1 year ago

Thanks for the report.

This function is executed at top level in store.js

https://github.com/mozilla/hubs/blob/5e16f77c190eeca2ee802eb73f0528449c14acab/src/storage/store.js#L17-L38

Probably it is executed before importing AFRAME.

I guess the order of importing depends on building and/or configuration? Anyways we may need to seek a proper way to execute this function after importing AFRAME.