Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
ff2a6fe
feat: add video output path support to camera recording APIs across p…
Mairramer May 5, 2026
ab84efa
more work
Mairramer May 6, 2026
445cfa1
style: fix linting and formatting issues across camera packages
Mairramer May 23, 2026
e25ab0e
fix camera tests
Mairramer May 23, 2026
0a7d03d
fix parameter
Mairramer May 24, 2026
91c91c1
fix param
Mairramer May 24, 2026
3d54807
feat: implement video recording with custom path support and add exam…
Mairramer May 24, 2026
22277b4
feat: add video output path parameter to startVideoRecording method a…
Mairramer May 24, 2026
c75fbaa
refactor: improve code formatting and readability in video recording …
Mairramer May 24, 2026
742c63d
feat: add support for CADisableMinimumFrameDurationOnPhone and UIAppl…
Mairramer May 24, 2026
c5691c7
feat: add support for document browsing in Info.plist
Mairramer May 24, 2026
0dc2583
refactor: remove videoOutputPath support from camera_web and update p…
Mairramer May 25, 2026
d7b0b51
Update packages/camera/camera_avfoundation/ios/camera_avfoundation/So…
Mairramer May 25, 2026
17c0bf6
Update packages/camera/camera_android/android/src/main/java/io/flutte…
Mairramer May 25, 2026
525ec56
Update packages/camera/camera_android_camerax/android/src/main/java/i…
Mairramer May 25, 2026
41572cf
refactor: restrict supported video output format to .mp4 across all p…
Mairramer May 25, 2026
b15fc47
format
Mairramer May 25, 2026
24ba3ac
feat: add documentation for custom video recording paths and remove w…
Mairramer May 25, 2026
7d3544e
fix
Mairramer May 25, 2026
9d1342f
refactor: simplify camera example by removing unused web file helpers…
Mairramer May 25, 2026
67f2bb1
fix
Mairramer May 25, 2026
508b2eb
Update packages/camera/camera/example/lib/video_recording_example.dart
Mairramer May 25, 2026
5b1c082
Merge branch 'main' into feat/add-custom-path-ouput-to-recording
Mairramer May 25, 2026
d663c37
rollback
Mairramer May 25, 2026
0cf24ef
Update packages/camera/camera/example/lib/video_recording_example.dart
Mairramer May 25, 2026
128511d
Update packages/camera/camera/example/lib/video_recording_example.dart
Mairramer May 25, 2026
26600d0
Update packages/camera/camera/example/lib/video_recording_example.dart
Mairramer May 25, 2026
409434d
Update packages/camera/camera/example/lib/video_recording_example.dart
Mairramer May 25, 2026
b2a8629
Update packages/camera/camera_windows/windows/capture_controller.cpp
Mairramer May 25, 2026
9aed89f
fix: improve video path handling in example app and resolve AVAssetWr…
Mairramer May 26, 2026
4905720
feat: add support for custom video output path in video recording acr…
Mairramer May 26, 2026
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
3 changes: 2 additions & 1 deletion packages/camera/camera/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT
## 0.13.0

* Adds `videoOutputPath` support to `startVideoRecording`.
* Updates minimum supported SDK version to Flutter 3.38/Dart 3.10.

## 0.12.0+1
Expand Down
58 changes: 55 additions & 3 deletions packages/camera/camera/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

A Flutter plugin for iOS, Android and Web allowing access to the device cameras.

| | Android | iOS | Web |
|----------------|---------|-----------|------------------------|
| **Support** | SDK 24+ | iOS 13.0+ | [See `camera_web `][1] |
| | Android | iOS | Web |
| ----------- | ------- | --------- | ---------------------- |
| **Support** | SDK 24+ | iOS 13.0+ | [See `camera_web `][1] |

## Features

Expand Down Expand Up @@ -92,6 +92,58 @@ Here is a list of all permission error codes that can be thrown:

- `AudioAccessRestricted`: iOS only for now. Thrown when audio access is restricted and users cannot grant permission (parental control).

### Custom Video Recording Path

You can optionally specify a `videoOutputPath` when calling `startVideoRecording()` to save the recorded video directly to a custom absolute file path on the device.

```dart
// Always ensure the path ends with the .mp4 extension
await controller.startVideoRecording(
videoOutputPath: '/path/to/your/custom_video.mp4',
);
```

#### Platform-Specific Considerations

**Android**

Although it is possible to use an absolute path like `/storage/emulated/0/Download/video.mp4`, this is a fragile practice and may fail on many devices or Android versions due to **Scoped Storage** restrictions.

- **Best Practice:** Always use the [path_provider](https://pub.dev/packages/path_provider) package to fetch a safe, writable directory.
- **Recommended Directory:** Use `getTemporaryDirectory()` or `getApplicationDocumentsDirectory()`.

```dart
import 'package:path/path.dart' as p;
import 'package:path_provider/path_provider.dart';

final directory = await getTemporaryDirectory();
final videoPath = p.join(directory.path, 'my_video.mp4');

await controller.startVideoRecording(videoOutputPath: videoPath);
```

**iOS**

By default, files saved within the application sandbox are private. If you want the recorded videos to be visible and manageable by the user inside the native iOS **Files app**:

1. Open your `ios/Runner/Info.plist` file.
2. Add the following keys set to `true`:

```xml
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
<key>UISupportsDocumentBrowser</key>
<true/>
```

**Windows**

Similar to Android, ensure you use the `path_provider` package to resolve a valid system path (such as `getApplicationDocumentsDirectory()` or `getApplicationSupportDirectory()`). This helps avoid OS permission issues (`Access Denied`) when writing files directly to protected directories like the root drive.

### Video Recording Example

For a complete, interactive demonstration of video recording with custom file output paths, error handling, and playback, please see the [Video Recording Example](https://github.com/flutter/packages/blob/main/packages/camera/camera/example/lib/video_recording_example.dart) in our example app.

### Example

Here is a small example flutter app displaying a full screen camera preview.
Expand Down
12 changes: 8 additions & 4 deletions packages/camera/camera/example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
<key>UISupportsDocumentBrowser</key>
<true/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
Expand All @@ -28,6 +34,8 @@
<string>Can I use the camera please? Only for demo purpose of the app</string>
<key>NSMicrophoneUsageDescription</key>
<string>Only for demo purpose of the app</string>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
Expand All @@ -46,9 +54,5 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>
Loading
Loading