Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[camera_web] Recording Video #4210

Merged
merged 32 commits into from
Sep 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0c6fac4
Add Support for Video Recording in Camera Web
ABausG Jul 31, 2021
65b2718
Add Documentation
ABausG Jul 31, 2021
4bd1173
Adding Tests
ABausG Jul 31, 2021
ce42759
Adding Error Handling
ABausG Jul 31, 2021
fdbe131
Formatting
ABausG Jul 31, 2021
4b1ae4c
Add missing call to get RecordedEvent Stream
ABausG Jul 31, 2021
2e6dfec
Rename onVideoRecordedEventStream
ABausG Aug 5, 2021
f252ffc
Unify logic from startVideoRecording and stopVideoRecording
ABausG Aug 5, 2021
d8114ab
throw PlatformExceptions
ABausG Aug 5, 2021
39adc96
Use srcObject
ABausG Aug 5, 2021
4db7748
Add Camera Tests
ABausG Aug 5, 2021
287bd4a
Fix Test and Stopping Video Recording
ABausG Aug 7, 2021
8f0f2fd
Clarify maxVideoDuration Test Issue
ABausG Aug 7, 2021
0e1d690
Merge branch 'upstream/master' into camera_web_recording
bselwe Aug 30, 2021
d38978f
feat: await closing videoRecorderController in Camera
bselwe Aug 30, 2021
ce5c1ca
docs: update video recording comments
bselwe Aug 30, 2021
a517757
feat: throw a CameraWebException if the video recording fails
bselwe Aug 30, 2021
2d1022f
test: add onEnded and onVideoRecordedEvent dispose tests
bselwe Aug 31, 2021
01a6999
test: update Camera video recording tests
bselwe Aug 31, 2021
4df6796
test: add missing CameraPlatform video recording tests
bselwe Aug 31, 2021
1d3906d
Merge branch 'upstream/master' into camera_web_recording
bselwe Aug 31, 2021
3c74e9e
feat: combine ondataavailable video blobs into a single video blob
bselwe Sep 3, 2021
f5863e9
test: update video recording tests for multiple video blobs
bselwe Sep 3, 2021
4552b01
docs: add video recording documentation
bselwe Sep 13, 2021
cd7f80d
feat: add Camera onVideoRecordingError stream
bselwe Sep 13, 2021
01b3210
test: add Camera onVideoRecordingError stream tests
bselwe Sep 13, 2021
c03fea6
feat: emit a CameraErrorEvent on video recording error
bselwe Sep 13, 2021
194db74
test: emit a CameraErrorEvent on video recording error tests
bselwe Sep 13, 2021
24ab126
Merge branch 'upstream/master' into camera_web_recording
bselwe Sep 14, 2021
787ee6b
feat: make prepareForVideoRecording a no-op
bselwe Sep 14, 2021
bc9c72a
Merge branch 'master' into camera_web_recording
ditman Sep 16, 2021
114cc46
Update CHANGELOG and pubspec
ditman Sep 16, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/camera/camera/lib/src/camera_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ class CameraController extends ValueNotifier<CameraValue> {
/// Preparing audio can cause a minor delay in the CameraPreview view on iOS.
/// If video recording is intended, calling this early eliminates this delay
/// that would otherwise be experienced when video recording is started.
/// This operation is a no-op on Android.
/// This operation is a no-op on Android and Web.
///
/// Throws a [CameraException] if the prepare fails.
Future<void> prepareForVideoRecording() async {
Expand Down
3 changes: 2 additions & 1 deletion packages/camera/camera_web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT
## 0.2.1

* Add video recording functionality.
* Fix cameraNotReadable error that prevented access to the camera on some Android devices.

## 0.2.0
Expand Down
17 changes: 15 additions & 2 deletions packages/camera/camera_web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,24 @@ if (kIsWeb) {
}
```

### Video recording

The video recording implementation is backed by [MediaRecorder Web API](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder) with the following [browser support](https://caniuse.com/mdn-api_mediarecorder):

![Data on support for the MediaRecorder feature across the major browsers from caniuse.com](https://caniuse.bitsofco.de/image/mediarecorder.png).

A video is recorded in one of the following video MIME types:
- video/webm (e.g. on Chrome or Firefox)
- video/mp4 (e.g. on Safari)

Pausing, resuming or stopping the video recording throws a `PlatformException` with the `videoRecordingNotStarted` error code if the video recording was not started.

For the browsers that do not support the video recording:
- `CameraPlatform.startVideoRecording` throws a `PlatformException` with the `notSupported` error code.

## Missing implementation

The web implementation of [`camera`][camera] is missing the following features:

- Video recording ([in progress](https://github.com/flutter/plugins/pull/4210))
- Exposure mode, point and offset
- Focus mode and point
- Sensor orientation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ void main() {
);
});

testWidgets('videoRecordingNotStarted', (tester) async {
expect(
CameraErrorCode.videoRecordingNotStarted.toString(),
equals('videoRecordingNotStarted'),
);
});

testWidgets('unknown', (tester) async {
expect(
CameraErrorCode.unknown.toString(),
Expand Down
Loading