NoSleep.js | Prevent display sleep and enable wake lock | iOS library
kandi X-RAY | NoSleep.js Summary
kandi X-RAY | NoSleep.js Summary
Prevent display sleep and enable wake lock in all Android and iOS web browsers. Check out the live demo in any Android or iOS web browser.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of NoSleep.js
NoSleep.js Key Features
NoSleep.js Examples and Code Snippets
Community Discussions
Trending Discussions on NoSleep.js
QUESTION
A-Frame makes use of nosleep.js to keep phones from sleeping (it plays a small video file in the background). For my use case, I need A-Frame to not activate nosleep.js.
I can disable nosleep.js by modifying the aframe.js file itself (search for "USE_WAKELOCK" and hardcode to false), but I'd prefer to do it programmatically in setup if possible. Is there any way to do this?
...ANSWER
Answered 2019-Apr-01 at 06:16The wakelock object is created as a property (source code). Here you can check out the implementation.
When entering VR mode it's executing wakelock.request()
, and upon exiting - wakelock.release()
.
Having a reference to the scene, you can call those methods:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install NoSleep.js
Install all development dependencies with:.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page