Wake Lock Demo

Status: Inactive

What is Wake Lock?

This page demonstrates the Screen Wake Lock API, which keeps your screen awake while this page is open. On Safari, it uses a small hidden video to achieve the same effect.

How it works

When you click Enable Wake Lock, this page either uses the official API or plays a hidden looping video to prevent the screen from dimming.

Key points:

Example code:


if ('wakeLock' in navigator) {
  await navigator.wakeLock.request('screen');
} else {
  // Fallback: play hidden looping video
  fallbackVideo.play();
}