Preventing Mobile Browsers From Turning Off
The code works by looping through a video which tricks the browser in to keeping the screen on.
npm install –save stayawake.js
import StayAwake from ‘stayawake.js’;
Once enabled a silent, hidden video element will play and the mobile device will stay awake on the page.