Skip to content

333van/NoScreenTimeout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Tap the screen to start.

What for?

I build this for my Android tablet to monitor various web resources, and experiment on graphics and WebGL.

How it work?

The page "fixes" the auto dimming or screen timeout feature of Android OS, common for smartphones and tablets, via a playback of an invisible video file, with the video source converted into a Base64 encoded data URI. The fix or hack is at the cost of high power consumption. I have read this hack from the Internet, but unfortunately, I have forgot its source.

# Generate a video with 2x2 resolution via ffmpeg
ffmpeg -f lavfi -i "color=color=black[black_video];[black_video]scale=2:2" -t 1 -c:v libx264 black.mp4
# Generate Base64 encoded data URI for the web via PowerShell, and send the output to clipboard
$FileContent = Get-Content -Path black.mp4; $Bytes = [System.Text.Encoding]::Unicode.GetBytes($FileContent); "data:video/mp4;base64," + [Convert]::ToBase64String($Bytes) | Set-Clipboard

What's next?

License

MIT

About

No Screen Timeout Fullscreen Webpage Boilerplate

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages