NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev
pub.dev, #619 most downloaded on pub.dev
A Flutter plugin for getting information about and controlling the camera on Web.
Latest stable
0.3.6
Last release 16 days ago
06 Nov 2026
Ships unpredictably
gaps range from 9 days to 1.3 years
Nearly every release is documented
notes for 31 of 31 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
31 releases · first in 2021
Drag across the ruler to compare, or tap a release to open it.
Adds image streaming to camera_web , so CameraController.startImageStream works on web. CameraPlugin.supportsImageStreaming() now returns true , and o
Adds image streaming to camera_web, so CameraController.startImageStream works on web. CameraPlugin.supportsImageStreaming() now returns true, and onStreamedFrameAvailable returns a stream of RGBA CameraImageData frames.
There are two capture paths, chosen per camera when it is created:
| Browser support | Path | Frame source |
|---|---|---|
MediaStreamTrackProcessor available (Chromium-based browsers) |
MediaStreamTrackProcessor → ReadableStream<VideoFrame> → VideoFrame.copyTo(format: 'RGBA') |
Every frame the camera track produces (maxBufferSize: 1, so the processor keeps only the newest frame when the consumer falls behind) |
| Otherwise (e.g. Firefox, Safari) | requestAnimationFrame loop → draw the <video> element to an OffscreenCanvas (or a regular canvas if OffscreenCanvas is unavailable) → getImageData |
Sampled at a 60 fps target |
Both paths emit a single-plane RGBA image (bytesPerPixel: 4, bytesPerRow set to the stride the browser reports). format is ImageFormatGroup.unknown with raw: 'rgba8888', because the platform interface has no RGBA group yet (see TODO, flutter/flutter#151193).
Every emitted frame has its own buffer. The copyTo destination is allocated per frame, and JSUint8Array.toDart returns a view of it, not a second copy. This matches the native implementations: a consumer can keep a CameraImage past the callback, for example across an await or when sending it to an isolate, and later frames won't change its bytes.
An earlier revision reused one buffer across frames. I benchmarked both approaches before switching (Chrome 155 with the fake camera; 640×480 to 1080p at 30, 60 and 90 fps; 3 runs per case):
A buffer pool would need an explicit release API on the platform interface, so I've left it as a possible follow-up.
Camera.dispose() now closes the stream.VideoFrame is always closed after it is copied, including on errors. The reader lock is released when the loop ends.unableToCloneFrame, missingPlaneLayout). The stream closes without an error if the track reader closes (videoTrackReaderClosed).onStreamedFrameAvailable, a CameraWebException is reported as a camera error event and rethrown as a PlatformException.CameraErrorCodes: noVideoTrack, videoTrackReaderClosed, videoTrackReaderNotInitialized, cameraFrameDimensionsZero, unableToCloneFrame, missingPlaneLayout.CameraServiceDOMException → CameraWebException mapping now lives in _domExceptionToCameraWebException, shared by getMediaStreamForOptions and the new frame-stream methods. DOMExceptions are now detected with isA<DOMException>() instead of on DOMException, so the check behaves the same under dart2wasm.hasMediaStreamTrackProcessor, hasPropertyOffScreenCanvas, takeFrame, getMediaStreamVideoTrack, getMediaStreamTrackReader, readVideoTrack, copyVideoFrameToBufferAndGetStride, getCameraImageData.MediaStreamTrackProcessor path delivers whatever the track produces. CameraImageStreamOptions has no fps field (TODO, flutter/flutter#176148).ImageFormatGroup (flutter/flutter#151193).MediaStreamTrackProcessor path. When Chrome crops and scales the track to fit the requested resolution (e.g. ResolutionPreset.low = 320×240 on a 1080p camera), the VideoFrame's visibleRect is the crop (1440×1080), and only displayWidth/displayHeight are 320×240. Frames are copied at visibleRect size, so they can be larger than previewSize. Scaling to the display size could be a follow-up.Fixes flutter/flutter#92460
flutter drive -d chrome for each file in example/integration_test/):
camera_web_stream_test.dart: supportsImageStreaming, onStreamedFrameAvailable, and the PlatformException mapping.camera_test.dart, in the cameraFrameStream group:
CameraImageData fails;unableToCloneFrame;camera_service_test.dart: each new CameraService method, including its error cases.camera_error_code_test.dart: the new error codes.startImageStream in Chrome using a fake camera (--use-file-for-fake-video-capture) at 640×480 to 1080p and 30–90 fps. That covered frame dimensions, stride and byte length, stopping and restarting the stream, background tabs, and dispose.Your coding agent can read these notes before it upgrades. Set up the MCP server →
web package version to 1.0.0.[camera_web] Skip video input devices that cannot be started in avail…
[camera_web] Skip video input devices that cannot be started in avail…
availableCameras failing when a video input device cannot be started, for example
a virtual camera without a video source. Such devices are now skipped.Migrates to package:web to support WASM
Uses CanvasRenderingContext2D.drawImage instead of the deprecated drawImageScaled.
CanvasRenderingContext2D.drawImage instead of the deprecated drawImageScaled.Fixes camera initialization failure on Firefox Android by using {video: true} instead of {video: {}} when no video constraints are specified.
{video: true} instead
of {video: {}} when no video constraints are specified.Fixes camera initialization failure on Safari by fixing a null check operator error using a nullable getter and null-safe practices.
Fixes a TypeError in availableCameras() caused by browsers (e.g. Firefox) returning an invalid facingMode capability value instead of the expected DOM
TypeError in availableCameras() caused by browsers (e.g. Firefox) returning
an invalid facingMode capability value instead of the expected DOMString sequence.Removes invalid @JS annotation from extension type constructors.
setFlashMode and takePicture threw on any camera that has a flash.
setFlashMode and takePicture threw on any camera that has a flash.
The Image Capture specification declares sequence<boolean> torch in
MediaTrackCapabilities. package:web is generated from that specification, so
torchNullable was typed JSArray<JSBoolean>?.
No browser ships that shape. Chromium and WebKit both declare a bare boolean torch.
Reading the property threw before the torch could be applied. The error depends on
the compiler:
| Compiler | Error |
|---|---|
| DDC | TypeError: true: type 'bool' is not a subtype of type 'JSArray<Object?>?' |
| dart2js | NoSuchMethodError: method not found: 'gq' |
| dart2wasm | ArgumentError: Invalid argument(s) |
The same line held two more defects:
.first gave the wrong answer for [false, true]. A specification-shaped sequence.first threw StateError on an empty sequence.Read torch as JSAny? and add canEnableTorch, which accepts either shape and
returns false for anything else.
A sequence is answered with any instead of first, and is only trusted when every
element is a boolean. Anything unrecognised raises torchModeNotSupported instead of
crashing, and prints a debug-only warning so the shape can be reported.
| Browser reports | Before | After |
|---|---|---|
true |
TypeError | torch on |
false |
TypeError | torchModeNotSupported |
[false, true] |
wrong answer | torch on |
[true] |
torch on | torch on |
[false] |
torchModeNotSupported | torchModeNotSupported |
[] |
StateError | torchModeNotSupported |
| key absent | torchModeNotSupported | torchModeNotSupported |
'yes' |
TypeError | torchModeNotSupported + warning |
['yes'] |
TypeError | torchModeNotSupported + warning |
Nine cases are covered by integration tests. Six of them fail without this change.
All nine shapes were run through the real plugin code on each of these. All passed.
| Device | Browser | Result |
|---|---|---|
| Moto G56 5G, Android 16 | Chrome 151 | 9 / 9 |
| macOS 26.3 | Safari 26.3 | 9 / 9 |
| iPhone 17 Pro simulator, iOS 26.1 | Safari | 9 / 9 |
| macOS 26.3 | Chrome 151, dart2js and dart2wasm | 9 / 9 |
On the Moto G56 the rear camera reports torch: true as a bare boolean, and the flash
now turns on. The front camera does not report the key at all and raises
torchModeNotSupported as expected.
canEnableTorch on NonStandardFieldsOnMediaTrackCapabilities, which reads either shape.debugPrint warning for a shape that is neither, so an unknown browser can0.3.5+6.JSArray<JSBoolean>? type on torchNullable, which no browser matches.?.toDart.first.toDart ?? false chain in _setTorchMode.Fixes flutter/flutter#191384
🤖 Generated with Claude Code
TypeError in setFlashMode and takePicture caused by browsers reporting the
torch capability as a boolean instead of the boolean sequence the Image Capture
specification describes.Removes maxVideoDuration/maxDuration, as the feature was never exposed at the app-facing package level, and is deprecated at the platform interface le…
maxVideoDuration/maxDuration, as the feature was never exposed at
the app-facing package level, and is deprecated at the platform interface
level.Adds support to control video FPS and bitrate. See CameraController.withSettings.
CameraController.withSettings.Changes availableCameras to not ask for the microphone permission.
availableCameras to not ask for the microphone permission.Updates README to improve example of Image creation.
Image creation.Adds pub topics to package metadata.
Updates minimum supported SDK version to Flutter 3.13.0/Dart 3.1.0.
dart:ui_web APIs.Updates minimum supported SDK version to Flutter 3.10/Dart 3.0.
Updates to latest camera platform interface, and fails if user attempts to use streaming with recording (since streaming is currently unsupported on w
Updates code for stricter lint checks.
Updates links for the merge of flutter/plugins into flutter/packages.
Clarifies explanation of endorsement in README.
Removes obsolete null checks on non-nullable values.
BREAKING CHANGE: Renames error code cameraPermission to CameraAccessDenied to be consistent with other platforms.
cameraPermission to CameraAccessDenied to be consistent with other platforms.Updates imports for prefer_relative_imports.
prefer_relative_imports.Add video recording functionality.
* Update usage documentation.
Fixes cameraNotReadable error that prevented access to the camera on some Android devices when initializing a camera.
Internal code cleanup for stricter analysis options.
Migrates from ui.hash* to Object.hash*.
ui.hash* to Object.hash*.Fixes library_private_types_in_public_api, sort_child_properties_last and use_key_in_widget_constructors lint warnings.
Minor fixes for new analysis options.
Initial release, adapted from the Flutter I/O Photobooth project.
One column per quarter.