
How to Access the Webcam in JavaScript
Access the webcam in JavaScript with getUserMedia: show a live video, choose a camera, capture a photo to canvas, handle permission errors and stop the stream.
Tag
5 posts

Access the webcam in JavaScript with getUserMedia: show a live video, choose a camera, capture a photo to canvas, handle permission errors and stop the stream.

A tour of small web APIs worth knowing: EyeDropper, Web Share, Screen Wake Lock, Vibration, Clipboard and Badging, with feature detection and support notes.

How the Payment Request API shows a native payment sheet from JavaScript: methods, details, canMakePayment, shipping options and the server-side steps.

Register a service worker with navigator.serviceWorker.register: scope, secure context, lifecycle, install and activate, updates, skipWaiting and debugging.

Build a weather app with fetch in vanilla JavaScript: geocode a city, request a forecast, handle loading and errors, convert units and render the result safely.