1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-06 03:50:04 +02:00
Oinktube/node_modules/cardboard-vr-display/node_modules/nosleep.js
2023-12-11 11:59:56 -03:00
..
dist https://github.com/WWBN/AVideo/issues/8713 2023-12-11 11:59:56 -03:00
example https://github.com/WWBN/AVideo/issues/8713 2023-12-11 11:59:56 -03:00
src https://github.com/WWBN/AVideo/issues/8713 2023-12-11 11:59:56 -03:00
.babelrc https://github.com/WWBN/AVideo/issues/8713 2023-12-11 11:59:56 -03:00
.editorconfig https://github.com/WWBN/AVideo/issues/8713 2023-12-11 11:59:56 -03:00
.npmignore https://github.com/WWBN/AVideo/issues/8713 2023-12-11 11:59:56 -03:00
bower.json https://github.com/WWBN/AVideo/issues/8713 2023-12-11 11:59:56 -03:00
package.json https://github.com/WWBN/AVideo/issues/8713 2023-12-11 11:59:56 -03:00
README.md https://github.com/WWBN/AVideo/issues/8713 2023-12-11 11:59:56 -03:00
webpack.config.js https://github.com/WWBN/AVideo/issues/8713 2023-12-11 11:59:56 -03:00

NoSleep.js

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.

Installation

This library is available on Bower as nosleep.

$> bower install nosleep

Alternatively, you can manually add NoSleep.js to your project (or the minified version).

Build from source

This repository uses webpack to build the distribution versions of the library. To build this library run webpack.

Usage

Create a new NoSleep object and then enable or disable it when needed as follows:

var noSleep = new NoSleep();

function enableNoSleep() {
  noSleep.enable();
  document.removeEventListener('touchstart', enableNoSleep, false);
}

// Enable wake lock.
// (must be wrapped in a user input event handler e.g. a mouse or touch handler)
document.addEventListener('touchstart', enableNoSleep, false);

// ...

// Disable wake lock at some point in the future.
// (does not need to be wrapped in any user input event handler)
noSleep.disable();

License

MIT. Copyright (c) Rich Tibbett