Skip to content

Conversation

@777genius
Copy link

Description

Updates documentation to explicitly state that the maxDuration parameter only applies when recording videos from the camera (ImageSource.camera), and is ignored when selecting videos from the gallery (ImageSource.gallery).

This addresses confusion reported in issue #83630 where developers expected maxDuration to filter gallery video selections, but it only controls camera recording duration.

Changes

  • Updated README.md with detailed explanation and code examples showing the difference between camera recording and gallery selection
  • Enhanced dartdoc comments for pickVideo() method with important notes about gallery behavior
  • Added clear warnings that maxDuration is ignored for gallery selections

Related Issues

Fixes flutter/flutter#83630

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

Updates documentation to explicitly state that the maxDuration parameter
only applies when recording videos from the camera (ImageSource.camera),
and is ignored when selecting videos from the gallery (ImageSource.gallery).

This addresses confusion reported in issue #83630 where developers expected
maxDuration to filter gallery video selections, but it only controls camera
recording duration.

Changes:
- Updated README.md with detailed explanation and code examples
- Enhanced dartdoc comments for pickVideo() method
- Added important notes about gallery selection behavior

Fixes flutter/flutter#83630
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 provides a valuable clarification to the documentation for the maxDuration parameter in pickVideo. By explicitly stating that it only applies to camera recordings and is ignored for gallery selections, it addresses a point of common developer confusion. The changes in both the README.md and the Dartdoc comments are clear and well-written. My review includes suggestions to extend this clarification to the pickMultiVideo method as well, to ensure consistency across the package's API, as it exhibits the same behavior.

Extends the documentation clarification to pickMultiVideo() method
to maintain consistency across the API. This method only selects
from the gallery, so maxDuration is always ignored.

Addresses feedback from code review.
Addresses remaining code review feedback by adding pickMultiVideo()
to the Video Duration Limitations section in README.

The maxDuration parameter is ignored for pickMultiVideo() as well,
since it only selects from the gallery.

Also added example code showing pickMultiVideo() usage with maxDuration.
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.

[image_picker] Update documentation of maxDuration to reflect that it only applies to recording

1 participant