ImagePickerWeb
This Web-Plugin allows Flutter Web to pick images (as File, Widget or Uint8List) and videos (as File or Uint8List). Many thanks goes to AlvaroVasconcelos for the implementation of picking images in his plugin: flutter_web_image_picker
Disclaimer for Videos
- Till now [Mar. 2020] it's not possible (due to security reasons) to play a local video file (see also video_player_web). But you can retreive the file and upload them somewhere and play it as a network source.
Getting Started
Add image_picker_web
to your pubspec.yaml:
Picking Images
Load Image as Image Widget:
Setting outputType
to ImageType.bytes
:
Setting outputType
to ImageType.file
:
How do I get all Informations out of my Image/Video (e.g. Image AND File in one run)?
Besides the standard getImage()
or getVideo()
methods you can use the getters:
getImageInfo
orgetVideoInfo
to acheive this.
Full Example
With getMultipleImageInfos()
you can get all three available types in one call.
Picking Videos
To load a video as html.File do:
To load a video as Uint8List do:
Reminder: Don't use Uint8List retreivement for big video files! Flutter can't handle that. Pick bigger sized videos and high-resolution videos as html.File!
After you uploaded your video somewhere hosted, you can retreive the network url to play it.
MediaInfos
- The methods
getVideoInfo
andgetImageInfo
are also available and you can use them to retreive further informations about your picked source.