camera_web
0.3.6, released 2 weeks ago by flutter.dev
Web platform implementation for the Flutter camera plugin.
What it does
Provides the web-specific implementation for the camera plugin, allowing Flutter apps to control camera devices, take pictures, and record video on web browsers. It uses the Stream, Image Capture, and MediaRecorder Web APIs.
AI-written summary of version 0.3.6, based on the package's README and metadata. Report an inaccuracy
Use it when
- You are developing a Flutter web application that needs to capture photos or record videos from a device camera.
- You are using the endorsed federated camera package and need web support included automatically.
Skip it when
- Your application requires features missing on the web implementation, such as exposure modes, focus control, or sensor orientation.
- You are running in an insecure context (non-HTTPS) where browser permissions for camera access will be denied.
Strengths
- Automatically included when using the main camera package via endorsed federation.
- Supports taking pictures, video recording, and camera image streaming on supported browsers.
- Migrated to package:web to fully support WASM.
Weaknesses
- Missing several advanced features available on mobile platforms like exposure and focus mode/point.
- Relies on browser support for Web APIs such as MediaRecorder and Image Capture which may vary.
- Requires a secure browsing context (HTTPS or localhost).
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
Serve your web application over HTTPS or localhost for local development to ensure secure context requirements are met for camera access.
final Image image;
if (kIsWeb) {
image = Image.network(capturedImage.path);
} else {
image = Image.file(File(capturedImage.path));
}Alternatives
Packages that do the same job and could replace camera_web.
- flutter_credit_card_scanner
Scan and extract credit card information using the device camera and on-device machine learning.
74Compare - camera_camera
Drop-in camera UI widget for taking photos with zoom, flash, and camera switching.
50Compare
Works with
Packages commonly used together with camera_web: ones it builds on, ones built on it, and its own family.
- webcamera_web depends on itLightweight bindings for browser APIs via JS interop
- stream_transformcamera_web depends on itExtension methods adding common stream transform operators
- camera_android_cameraxSame familyAndroid camera implementation using CameraX library
- camera_avfoundationSame familyiOS implementation of the Flutter camera plugin providing preview, photo, and video capture.
- camera_androidSame familyAndroid implementation of the camera plugin using the Camera2 library.
- camera_windowsSame familyWindows implementation of the camera plugin for getting info and controlling cameras
- cameraBuilt on camera_webFlutter plugin to preview, capture photos/video and stream camera images.