Sitelet https://github.com/flutter/packages/pull/11774
Skip to content

[camera] add custom path ouput to recording - #11774

Merged
auto-submit[bot] merged 67 commits into
flutter:mainfrom
Mairramer:feat/add-custom-path-ouput-to-recording
Sep 24, 2026
Merged

auto-submit[bot] merged 67 commits into
flutter:mainfrom
Mairramer:feat/add-custom-path-ouput-to-recording

Conversation

@Mairramer

@Mairramer Mairramer commented May 25, 2026 •

Copy link
Copy Markdown
Contributor

This PR introduces the ability to save videos to custom locations, taking into account the limitations and behavior of each platform.

Due to platform-specific security restrictions and limitations:

  • On Android, I was able to save videos directly to /storage/emulated/0/Download/video.mp4 without issues.
  • On iOS, I was able to save videos to On My iPhone -> Camera Example -> Movies.
  • On Windows, the behavior is similar to Android.

Closes flutter/flutter#91680

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2

@Mairramer

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for a custom videoOutputPath to the startVideoRecording API across Android, iOS, Windows, and Web platforms. The changes include updates to the camera_platform_interface, native implementation logic for path validation, and a new interactive example app. Technical feedback identifies several improvement opportunities: the Android example should use path_provider instead of hardcoded paths, and the UI should be updated to reflect that content:// URIs are not supported. Additionally, the reviewer recommended properly managing TextEditingController lifecycles, using locale-aware string conversions in Java, fixing a potential logic error in the Swift path validation, and integrating the new demo into the existing example app structure rather than replacing the main entry point.

Comment thread packages/camera/camera/example/lib/video_recording_example.dart Outdated
Comment thread packages/camera/camera/example/lib/video_recording_example.dart Outdated
Comment thread packages/camera/camera/example/lib/video_recording_example.dart Outdated
Comment thread packages/camera/camera/example/lib/main.dart Outdated
Mairramer and others added 8 commits May 25, 2026 09:17
…urces/camera_avfoundation/DefaultCamera.swift

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…r/plugins/camera/Camera.java

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…o/flutter/plugins/camerax/RecorderProxyApi.java

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@Mairramer

Copy link
Copy Markdown
Contributor Author

/gemini review

@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Sep 11, 2026
@Mairramer Mairramer added the CICD Run CI/CD label Sep 11, 2026
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Sep 11, 2026
@Mairramer Mairramer added the CICD Run CI/CD label Sep 11, 2026
@bparrishMines bparrishMines added the federated: all_changes PR that contains changes for all packages for a federated plugin change label Sep 14, 2026

@bparrishMines bparrishMines left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Platform interface and app facing look good to me. It looks like there isn't a camera_web implementation, but I'm assuming this is because you can't access the file system with web.

However, to keep platform parity and prevent web from ignoring the value silently, can you update the file creation name at:

https://github.com/flutter/packages/blob/main/packages/camera/camera_web/lib/src/camera.dart#L470

And then also do a check that it is only a filename and doesn't include directories (e.g. myVideo.mp4 and not some/folder/myVideo.mp4.

The windows implementation looks fine to me as well, but I'm not that familiar with the platform. @stuartmorgan-g Is there someone that usually handles that review or is it up to me?

auto-submit Bot pushed a commit that referenced this pull request Sep 18, 2026
…oRecording (#12667)

Part of #11774

## Pre-Review Checklist

**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
@Mairramer

Mairramer commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor Author

LGTM

Platform interface and app facing look good to me. It looks like there isn't a camera_web implementation, but I'm assuming this is because you can't access the file system with web.

However, to keep platform parity and prevent web from ignoring the value silently, can you update the file creation name at:

https://github.com/flutter/packages/blob/main/packages/camera/camera_web/lib/src/camera.dart#L470

And then also do a check that it is only a filename and doesn't include directories (e.g. myVideo.mp4 and not some/folder/myVideo.mp4.

The windows implementation looks fine to me as well, but I'm not that familiar with the platform. @stuartmorgan-g Is there someone that usually handles that review or is it up to me?

For now, I’ve avoided changing the web implementation. But I’ll take a closer look at it separately.
Edit:
If needed, I can create a separate issue for the web implementation and close the current one, since this will be supported on three platforms and only the web, with its specific quirks, would be left out for now.

# Conflicts:
#	packages/camera/camera_platform_interface/test/method_channel/method_channel_camera_test.dart
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Sep 18, 2026
@Mairramer Mairramer added the CICD Run CI/CD label Sep 18, 2026
@stuartmorgan-g

Copy link
Copy Markdown
Collaborator

@stuartmorgan-g Is there someone that usually handles that review or is it up to me?

Windows reviews have mostly been me recently, but @Piinks is following up on ownership for Windows plugin implementations.

@Piinks
Piinks requested a review from a team September 22, 2026 15:17
@Piinks Piinks added the triage-windows Should be looked at in Windows triage label Sep 22, 2026
@Piinks

Piinks commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Touched base with @loic-sharma, added @flutter/windows-reviewers and tagged triage-windows for review.

@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Sep 22, 2026
@Mairramer Mairramer added the CICD Run CI/CD label Sep 22, 2026
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Sep 24, 2026
@Mairramer Mairramer added the CICD Run CI/CD label Sep 24, 2026
@hellohuanlin hellohuanlin added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 24, 2026
@auto-submit
auto-submit Bot merged commit c5c44ee into flutter:main Sep 24, 2026
14 checks passed
pull Bot pushed a commit to fucheng-guo-sun/flutter that referenced this pull request Sep 25, 2026
…r#193351)

flutter/packages@431ea69...e55e7ac

2026-09-25 50643541+Mairramer@users.noreply.github.com [material_ui] Add
labelTextDirection handling in InputDecorator (flutter/packages#12607)
2026-09-24 tarrinneal@gmail.com [pigeon] Fix NSnumber edge cases and
null value bug (flutter/packages#12997)
2026-09-24 50643541+Mairramer@users.noreply.github.com [camera] add
custom path ouput to recording (flutter/packages#11774)
2026-09-24 jessiewong401@gmail.com [Android 17] Update packages CI test
runners to SDK 37 (flutter/packages#12376)
2026-09-24 21270878+elliette@users.noreply.github.com
[pigeon][video_player] Disable `video_player` and `pigeon` flakes
blocking latest flutter -> packages roll (flutter/packages#13003)
2026-09-24 5684363+tenninebt@users.noreply.github.com
[google_maps_flutter] Add onPointOfInterestTap platform implementations
(flutter/packages#12880)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD federated: all_changes PR that contains changes for all packages for a federated plugin change p: camera platform-android platform-ios platform-macos platform-windows triage-android Should be looked at in Android triage triage-ios Should be looked at in iOS triage triage-windows Should be looked at in Windows triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Camera]: Proposal to add set path file on startVideoRecording