flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
165.64k stars 27.35k forks source link

[image_picker] Support maxRecordedFileSize on pickVideo method #117426

Open mafreud opened 1 year ago

mafreud commented 1 year ago

First of all, thank you so much for creating the best package!! My suggestion is to add a property like swift's maxRecordedFileSize to the image picker. pickImage method has a method to adjust the file size but pickVideo does not.

stuartmorgan commented 1 year ago

My suggestion is to add a property like swift's maxRecordedFileSize to the image picker.

It looks like this is only relevant for a capture source; UIImagePickerController allows specifying a max duration, but not a max size in bytes, so we'd need to clearly document that.

pickImage method has a method to adjust the file size but pickVideo does not.

maxRecordedFileSize doesn't allow adjusting the file size after the fact, so you'd be getting very different functionality from what the max image resolution provides. Is that actually what you want, or are you looking for something that re-encodes an existing video after the fact to a smaller size? The latter is probably out of scope for this plugin, and something best implemented in a separate plugin.