1

I have got a website that runs on , ,and . Im hopping there is a way to stop the mobile device (tablets, and ) from going to sleep.

I have done some research on this but they are not very helpful. I have tried NoSleep.js and the answer from This answer from SO but they all seems not working, my (ver 6.0) would still go to sleep and my iphone 6s goes to sleep too.

Any solutions?

Edit: For performance I prefer not to have an invisible video or audio playing in the background

Community
  • 1
  • 1
A Web-Developer
  • 868
  • 8
  • 29
  • What higher level problem are you trying to solve? This sounds like an XY-problem – charlietfl Jan 26 '16 at 00:43
  • @charlietfl The problem is after the screen go dim one of the API we are using will not be able to renew its user token. We have no control over their API and we have done too much to change to another API. – A Web-Developer Jan 26 '16 at 01:05
  • seems like you need to look for a refresh method and put a UI notification up for user instead ..... *"oops you went to sleep, click here..."* – charlietfl Jan 26 '16 at 01:11
  • @charlietfl we thought of doing that but not everyone set their mobile devices to sleep after 1 min or 30 sec. We dont want to annoy the customers with our pop ups every 30 sec and i maybe wrong but i dont think there is a way to get how long the screen will dim from a browser :( – A Web-Developer Jan 26 '16 at 03:57
  • and by same token...if you could stop phone from sleeping they wouldn't like you either – charlietfl Jan 26 '16 at 04:00
  • @charlietfl We will tell the user that when they are on this page we will try to stop their phone from sleeping so they dont lose their progress and since im expecting to achieve this in js, they can still lock their phone via lock button or when they switch to other apps, hips of app are doing that already. I personally did 2 apps that prevents screen from dimming. – A Web-Developer Jan 26 '16 at 04:04

0 Answers0