Open tazo-taz opened 8 months ago
This is a known bug on iOS: https://bugs.webkit.org/show_bug.cgi?id=254545
The video method works both in PWA and Safari on iOS 17. But the library doesn't use it because navigator.wakeLock is available. So the library maintainer should either use both navigator.wakeLock
and video, or provide an option for us to choose.
As user, you can copy the library code to your website and modify it so both methods are used.
@Finesse thank you for response, I tried that by break if else if else and it will enter into both condition but still has same problem on PWA any more ideas to fix or did you manage you to fix that
@tazo-taz No, I failed to make it work reliably. I chose to use my app in Safari, because wake lock works more reliably there. Though it requires user action to activate, so I made an infinite loop waiting for any user action, then waiting for a lock release, then waiting for user action and so on.
Expected Behavior
The noSleep.enable() function should prevent the screen from sleeping when the web application is launched from a bookmark saved as an application on an iPhone.
Actual Behavior
The noSleep.enable() function does not prevent the screen from sleeping when the web application is launched from a bookmark.
Code