Reputation: 134
EveryOne I want to pick multiple video from gallery and show in my flutter app but I am unable to do this.
Upvotes: 1
Views: 2870
Reputation: 1
The following doesn't allow picking from gallery:
final result = await FilePicker.platform.pickFiles(
allowMultiple: true,
type: FileType.custom,
allowedExtensions: ['mp4'],
withData: false,
withReadStream: true,
allowCompression: false,
);
If we use allowedExtensions: ['mp4']
and type: FileType.custom
then picked videos are not from galley. If we want to pick from gallery use type: FileType.video
only as follows:
final result = await FilePicker.platform.pickFiles(
allowMultiple: true,
type: FileType.video,
withData: false,
withReadStream: true,
allowCompression: false,
);
Upvotes: 0
Reputation: 606
You can use file_picker, it has option to pick/upload multiple files i.e
FilePickerResult? result = await FilePicker.platform.pickFiles(allowMultiple: true);
as well as Multiple files with extension filter i.e
FilePickerResult? result = await FilePicker.platform.pickFiles(
type: FileType.custom,
allowedExtensions: ['jpg', 'pdf', 'doc'],
);
Upvotes: 2