jean-emmanuel / open-stage-control

Libre and modular OSC / MIDI controller
https://openstagecontrol.ammd.net
GNU General Public License v3.0
695 stars 88 forks source link

[Bug] Prevent Sleep not working #817

Closed mr-plaid closed 1 year ago

mr-plaid commented 1 year ago

Hello! I've been playing around with the "prevent sleep" option when using a mobile device, but sadly it does not seem to work.

I am trying this using Chrome on a Samsung Galaxy Tab S7. I tried using several different sessions, including a fresh blank session, and still no success. I am using O-S-C v1.23.0

I did some experimenting/investigating, and I tested the NoSleep.js live demo using the same setup, and it worked correctly. Though after looking through the NoSleep.js repo, it looks like it may be somewhat unmaintained at this point, and perhaps has some issues in the library itself...

Anyways, not sure if there's a simple fix for it or not. It looks like there is also a fairly straightforward Screen Wake Lock API that is perhaps worth investigating??

Let me know if I can provide any more useful details.

Thanks for your investigation/consideration!

jean-emmanuel commented 1 year ago

Thanks for the report, I'll take a look at this when I can :)

jean-emmanuel commented 1 year ago

Well shame on me, it looks like I managed to break that a long time ago simply by reversing an if/else statement... it's now fixed and also takes advantage of the wake lock api when available (thanks for the pointers).