bp2008 / ui3

A powerful, modern HTML5 web interface for Blue Iris.
GNU Lesser General Public License v3.0
120 stars 18 forks source link

[bug] UI3 PWA on Android always rotates, ignoring the OS's rotation lock setting #144

Closed lightmaster closed 1 year ago

lightmaster commented 1 year ago

If you have UI3's PWA installed, and have Android's Auto Rotate toggled disabled (so the screen will not rotate), UI3's PWA will still rotate. This is caused by the manifest.json entry "orientation": "any". If this entry is removed and the PWA is reinstalled (or wait sufficient time for Android to check if there's an update to the manifest.json), then the PWA will start obeying the Auto Rorate setting.

lightmaster commented 1 year ago

I submitted PR #145 to correct this.

bp2008 commented 1 year ago

Bizarre! How did you figure that out? I can find no evidence anywhere else that "orientation": "any" would break the rotation lock.

lightmaster commented 1 year ago

Bizarre! How did you figure that out? I can find no evidence anywhere else that "orientation": "any" would break the rotation lock.

https://stackoverflow.com/questions/73956593/pwa-ignores-os-orientation-lock-on-android

lightmaster commented 1 year ago

I didn't think it had worked at first, but then I tried uninstalling the PWA and reinstalling it to force it to grab the new manifest, and it worked. PWA will get a new manifest eventually, based on whatever it's cache timeout is.

orientation is used to force the PWA into a specific orientation, however somewhat bizarrely, "any" makes it ignore the OS's rotation setting and forces it to always go by the accelerometer values. From what I can find, any defined value will override the OS setting.

bp2008 commented 1 year ago

For future reference, if you find UI3's version number in ui3.htm and change it by adding a letter or something, that should force it to grab a new copy of everything. Just don't edit it to a version number I'm likely to ever use in a real release because that would mean you had the wrong copy cached.

bp2008 commented 1 year ago

Implemented in UI3-245.