soundscape-community / soundscape-web-client

Intelligent navigation on any platform
MIT License
2 stars 2 forks source link

Keep screen on while active #9

Closed steinbro closed 5 months ago

steinbro commented 8 months ago

Since the Soundscape web app doesn't need much interaction, the device tends to auto-lock even when the app is open and active. At least on iOS Safari, my understanding is that geolocation updates aren't reported to websites while the device is locked. Thus, callouts are stopped prematurely.

Is there a way to keep the screen on when a callout mode is enabled, e.g. by pretending that a video is playing?

ragar3 commented 5 months ago

I think another feasible solution is to use the Screen Wake Lock API , which seems to be supported by most common browsers, including iOS Safari Unfortunately, it does look like it won't work on iOS Safari if the user has the site installed as a home screen web app. If that's not an acceptable caveat, then the best workaround would be to have a silently repeating audio/video in the background, as you suggested. Either way, I can get started on this.

steinbro commented 5 months ago

Thanks for the insight! I was not familiar with the Screen Web Lock API. That looks like the most straightforward and appropriate way to accomplish this, so I'd certainly welcome that implementation.