Created
August 19, 2020 21:40
-
-
Save mulieriq/47488a1052709b3d72dceae06c1eef7f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Future getVideo() async { | |
setState(() { | |
video = null; | |
thumbfilepath = null; | |
}); | |
setState(() { | |
messageid = DateTime.now().millisecondsSinceEpoch.toString(); | |
}); | |
var vinput = await ImagePicker.pickVideo(source: ImageSource.gallery); | |
final uint8list = await VideoThumbnail.thumbnailFile( | |
video: vinput.path, | |
imageFormat: ImageFormat.JPEG, | |
maxWidth: | |
500, // specify the width of the thumbnail, let the height auto-scaled to keep the source aspect ratio | |
quality: 25, | |
); | |
print(uint8list); | |
setState(() { | |
mdeiafilesize = filesize(vinput.lengthSync()); | |
video = vinput; | |
thumbfilepath = uint8list; | |
}); | |
uploadVideo(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment