In an iOS app you can set application.idleTimerDisabled = YES to prevent the phone from auto locking.
I need to do this in mobile safari for a game li
NoSleep.js seems to work in iOS 11 and it reportedly works on Android as well.
This is a simple HTML-only method to do that: looping inline autoplaying videos (it might also work in Android Chrome 53+)
See the same demo on CodePen (includes a stopwatch)
video.play()