richtr / NoSleep.js

Prevent display sleep and enable wake lock in any Android or iOS web browser.
MIT License
2.19k stars 379 forks source link

Live demo doesn't work on iOS 14.4 Safari #123

Open Empereol opened 3 years ago

Empereol commented 3 years ago

Expected Behavior

Live demo (https://richtr.github.io/NoSleep.js/example/) should work on iOS 14.4 Safari and prevent device screen from turning off when "Wake lock is enabled"

Actual Behavior

Live demo does not prevent device screen from turning off.

How Do We Reproduce?

  1. Go to https://richtr.github.io/NoSleep.js/example/ in Safari on iOS 14.4
  2. Hit button ("Wake Lock is disabled"). Screen should turn green and button should now say "Wake Lock is enabled"
  3. Observe device until screen turns off.
wlekin commented 3 years ago

it only work while your iphone is charging after 14.5

rejnok93 commented 3 years ago

And the problem is with live demo only or simply NoSleep.js stopped working for iOS >=14.4 ??

wlekin commented 3 years ago

And the problem is with live demo only or simply NoSleep.js stopped working for iOS >=14.4 ??

not working for some reason after ios 14.4. in the meantime i just put a zero opacity video tag without muted and loop to keep iphone awake.

SilverTraveller commented 3 years ago

iOS 14.4 and beyond requires user interaction before the this.noSleepVideo.play() command in NoSleep.js will operate, otherwise an "Unhandled Promise Rejection: NotAllowedError: The request...." will occur.

sanishkr commented 2 years ago

I am running on iOS 14.7.1, both safari and chrome seem to be not working. Any idea or workaround, please? @richtr