Skip to content

[image_picker] Add videoQuality parameter - platform_interface#11144

Open
Koichi5 wants to merge 1 commit intoflutter:mainfrom
Koichi5:feat/image_picker_video_quality_platform_interface
Open

[image_picker] Add videoQuality parameter - platform_interface#11144
Koichi5 wants to merge 1 commit intoflutter:mainfrom
Koichi5:feat/image_picker_video_quality_platform_interface

Conversation

@Koichi5
Copy link

@Koichi5 Koichi5 commented Mar 1, 2026

Description

Adds VideoQuality enum and an optional quality parameter to getVideo
in the platform interface, so callers can choose low, medium, or high quality
when recording or picking video. Defaults to high quality for backward compatibility.

Part 1 of 3 for flutter/flutter#179940

Related PRs

Pre-Review Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] page, which explains my responsibilities.
  • I read and followed the [relevant style guides] and ran [the auto-formatter].
  • I signed the [CLA].
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I [linked to at least one issue that this PR fixes] in the description above.
  • I followed [the version and CHANGELOG instructions], using [semantic versioning] and the [repository CHANGELOG style], or I have commented below to indicate which documented exception this PR falls under[^1].
  • I updated/added any relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or I have commented below to indicate which [test exemption] this PR falls under[^1].
  • All existing and new tests are passing.

Adds VideoQuality enum and an optional quality parameter to getVideo
in the platform interface.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Koichi5 Koichi5 requested a review from tarrinneal as a code owner March 1, 2026 10:38
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@google-cla
Copy link

google-cla bot commented Mar 1, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link

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

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 introduces a videoQuality parameter to allow selecting video quality when picking videos. It adds a VideoQuality enum and updates the getVideo method in the platform interface and its implementations. My review has identified a few critical issues where the new quality parameter is not correctly passed through all code paths, specifically in MethodChannelImagePicker and CameraDelegatingImagePickerPlatform. Additionally, I've suggested an improvement to the documentation for the new VideoQuality enum to clarify its behavior on Android.

required ImageSource source,
CameraDevice preferredCameraDevice = CameraDevice.rear,
Duration? maxDuration,
VideoQuality quality = VideoQuality.high,

Choose a reason for hiding this comment

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

critical

The new quality parameter is not being used. It needs to be passed down to the native implementation.

This will require:

  1. Passing quality to _getVideoPath.
  2. Updating _getVideoPath to accept quality and pass it to the method channel invocation for pickVideo.

required ImageSource source,
CameraDevice preferredCameraDevice = CameraDevice.rear,
Duration? maxDuration,
VideoQuality quality = VideoQuality.high,

Choose a reason for hiding this comment

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

critical

The new quality parameter is not used when source is ImageSource.camera. It should be passed to the camera delegate.

This will require:

  1. Adding a videoQuality property to ImagePickerCameraDelegateOptions.
  2. Passing the quality to ImagePickerCameraDelegateOptions when calling delegate.takeVideo.


/// Video quality setting for video recording/picking.
///
/// This enum corresponds to `UIImagePickerControllerQualityType` on iOS.

Choose a reason for hiding this comment

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

medium

It would be helpful to also document the correspondence on Android. On Android, this will likely correspond to MediaStore.EXTRA_VIDEO_QUALITY, which only supports high (1) and low (0) quality. Please clarify how medium will be handled on Android.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant