Skip to content

Instantly share code, notes, and snippets.

@ponnamkarthik
Last active October 28, 2020 01:11
File _video;
final picker = ImagePicker();
// This funcion will helps you to pick a Video File
_pickVideo() async {
PickedFile pickedFile = await picker.getVideo(source: ImageSource.gallery);
_video = File(pickedFile.path);
_videoPlayerController = VideoPlayerController.file(_video)..initialize().then((_) {
setState(() { });
_videoPlayerController.play();
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment