Browser Support
Quagga2 makes use of many modern Web APIs which are not implemented by all browsers yet. This page details browser compatibility and required APIs.
Operating Modes
Quagga2 operates in two modes:
- Analyzing static images - Process existing image files
- Using a camera - Decode images from a live video stream
The latter requires the MediaDevices API for camera access.
Browser Compatibility
You can track the compatibility of the used Web APIs for each mode:
Static Image Mode
The following APIs must be supported by your browser:
Live Stream Mode
In addition to the APIs required for static images:
- MediaDevices API - Required for camera access
Secure Origins Required
Important: Accessing getUserMedia requires a secure origin in most browsers:
http://can only be used onlocalhost- All other hostnames must be served via
https://
This is a browser security requirement. Read more in the Chrome M47 WebRTC Release Notes.
Feature Detection
Detecting getUserMedia Support
Every browser implements the mediaDevices.getUserMedia API differently. It’s highly recommended to include webrtc-adapter in your project for cross-browser compatibility.
How to test browser capabilities:
if (navigator.mediaDevices && typeof navigator.mediaDevices.getUserMedia === 'function') {
// Safe to use getUserMedia
console.log('Camera access is supported');
} else {
// Camera access not available
console.log('Camera access is NOT supported');
}
Browser Support Table
The above condition evaluates as follows:
| Browser | Result | Notes |
|---|---|---|
| Chrome | true |
Full support |
| Firefox | true |
Full support |
| Edge | true |
Full support |
| Safari iOS | true |
Requires HTTPS |
| IE 11 | false |
Not supported |
| Safari Desktop | true |
macOS 11+ |
Known Issues
iOS Torch/Flash
Torch (flash) control via CameraAccess.enableTorch() and CameraAccess.disableTorch() does not work on iOS devices running version 16.4 and earlier. Support on later versions may vary.
Safari Limitations
- Older Safari versions may require user interaction before camera access
- Some older iOS versions have limited WebRTC support
Internet Explorer
Internet Explorer 11 and below do not support the MediaDevices API and cannot use live camera features. Static image decoding may work with polyfills, but this is not officially supported.
Recommendations
For best compatibility:
- Use HTTPS - Required for camera access on all non-localhost domains
- Include webrtc-adapter - Normalizes browser differences
- Feature detect - Check for API support before attempting to use camera
- Provide fallbacks - Offer file upload as alternative to camera access
- Test thoroughly - Browser behavior varies, especially on mobile
Related
- Configuration Reference - How to configure Quagga2
- Camera Access API - Camera control methods
- Getting Started - Installation and setup