Launch Handler API Demo - Online Control App Launch Behavior
Configure how your PWA launches: focus existing or create new. Test with the launch_handler manifest field.
UD5 Toolkit
navigator.mediaSession.
if ('mediaSession' in navigator) { ... }.
navigator.mediaSession.metadata = new MediaMetadata({...}) to set the track information. The MediaMetadata constructor accepts: title, artist, album, and artwork (an array of image objects with src, sizes, and type). For best results, provide multiple artwork sizes (96x96, 128x128, 192x192, 256x256, 384x384, 512x512) to accommodate different platform requirements.
navigator.mediaSession.setActionHandler('play', callback) and setActionHandler('pause', callback). Available actions include: play, pause, previoustrack, nexttrack, seekbackward, seekforward, seekto, and stop. Each handler receives an optional details object. Important: Action handlers may require an active audio playback context to be recognized by the system.
navigator.mediaSession.metadata is set with at least a title. (3) HTTP instead of HTTPS — Media Session API requires a secure context (HTTPS or localhost). (4) Browser limitations — some browsers only show media controls when audio is actively streaming. (5) User gesture required — initial audio playback must be triggered by a user click/tap.
navigator.mediaSession.setPositionState({ duration: totalSeconds, playbackRate: 1, position: currentSeconds }) to synchronize the progress bar on system media controls. Update this periodically (e.g., every second) while the media is playing. The position should reflect the current playback time, and duration the total length of the track. This enables accurate seek and scrub controls on lock screens and notification widgets.
sizes attribute should match the actual image dimensions (e.g., "256x256"). Always include a fallback image. On mobile, higher resolution artwork (≥512px) ensures crisp display on high-DPI screens. Keep file sizes reasonable for fast loading.
<audio> elements, AudioContext, Web Audio API nodes, or even WebRTC streams. As long as the browser detects active audio playback, the Media Session will be recognized. This makes it ideal for custom audio players, synthesizers, podcast players, and streaming services built with Web Audio.
chrome://media-engagement/ to see media playback status. Check the Console for any errors related to Media Session. Quick checks: (1) Verify HTTPS or localhost. (2) Confirm audio is actually playing (not muted with zero gain). (3) Test navigator.mediaSession.metadata in the console — it should return the MediaMetadata object. (4) Use the demo tool on this page to test if your browser supports the API correctly. (5) Check that action handlers are properly bound after user interaction.
display: standalone) and service worker caching for offline playback, you can create a near-native media experience entirely with web technologies.
Configure how your PWA launches: focus existing or create new. Test with the launch_handler manifest field.
Compress and decompress text using the browser's native Compression Streams API. See the binary output size.
Query the permission state of camera, microphone, geolocation, and more. See the response and learn the API.
Drop a PNG file and see all its chunks (IHDR, tEXt, etc.). Extract hidden text and color profiles. Pure JavaScript reader.
Unified input demo: see pressure, tilt, and type from any pointer. Compare pointerType values. Essential for drawing apps.
Toggle a screen wake lock to prevent the device from dimming or sleeping. See the lock state and learn the API.
Drop a video file and instantly see its container format, codec(s), resolution, duration, and bitrate. Browser‑based, no upload.
Decode an image progressively using the ImageDecoder API. See partial results and metadata. Modern alternative to <img>.
Decode individual video frames from a local file using the VideoDecoder API. Step through frames. Cutting‑edge browser feature.
Experiment with the Federated Credential Management API. Simulate a sign‑in flow without third‑party cookies. Privacy‑first.
Request HID devices and list them. Read input reports and send output. For custom hardware and controllers.
Request permission and detect when the user is idle (away from keyboard). See screen lock state. For native‑like apps.
Demonstrate how the Web OTP API automatically reads one‑time codes from SMS (mobile). Simulation with a fake SMS input.
Acquire and release locks across tabs. Prevent race conditions in IndexedDB or localStorage. Visual queue and lock state.
Connect a gamepad and see all button presses and axis movements visually. Check that every input is detected correctly.
Trigger different vibration patterns on mobile devices. Test if your phone supports haptic feedback. Simple demo.
Display your effective connection type (4g, 3g, etc.) and downlink speed using the Navigator API. Adapt your app accordingly.
See your device's battery level, charging status, and discharge time using the Battery Status API. Fun utility.
Check current screen orientation and test the lock API. Useful for mobile web apps. Demo with code.
Test the new HTML popover attribute for creating accessible tooltips, menus, and dialogs without JavaScript. Copy code snippets.
See the View Transitions API in action. Cross‑fade and morph between two states. Copy the JavaScript starter code.
Experiment with the Async Clipboard API: read/write text and images from the clipboard. Verify permissions and see demo code.
Test the Web Share API by sharing text, links, and files directly from the browser. Check compatibility and see example code.
Enter an API URL and quickly check its HTTP status code and response time. See response headers and body. Browser fetch.
Drop a PDF and see its embedded metadata: author, title, creation date, and more. No content is uploaded; pure browser PDF parsing.
Drop an audio file and instantly see its duration in seconds and formatted time. Read metadata without full playback.
Pick a method, URL, headers, and body, then send an HTTP request directly from your browser. Debug APIs easily.
Generate random JSON data with customizable fields (users, products, orders). Useful for frontend mocking. All local.
Execute GraphQL queries against any endpoint with variables and headers. Explore schema via introspection. All requests made directly from your browser.
Extract and view EXIF data from photos including camera settings, GPS location, and timestamps. All metadata read locally, your photos stay private.