flutter read local Directories which contains videos? - flutter

i want to make a media player
i want to read all device directories (device storage and Sd card) and show which contains videos
like this

Using this package
https://pub.dev/packages/photo_manager
final List<AssetPathEntity> paths = await PhotoManager.getAssetPathList(type: RequestType.video);
This package will help u to retrieve albums but u have to build your own UI to display it.

Related

Is there a way to store data in android folder with flutter?

Is there any way to store data(images, audio files, titles etc) in the project folder inside Android folder. And later access it later in case of no internet?? Right now I am displaying the images and playing audio mp3 directly from API response. Any help would be highly appreciated.

Flutter Video Player

I wanted a flutter app, which downloads video from the network and stores it in local memory. Video stored in local memory should not be accessible by other media players. Those videos should only be shown by my apps video player. Is it possible to do it in flutter?
you can store video in application directory, other apps cannot access it
import 'package:path_provider/path_provider.dart' as path_provider;
final directory = await path_provider.getApplicationDocumentsDirectory();

Flutter - Upload Video to Youtube

In my app I need the ability to take and upload or save a short 5 to 15 second video. I also need to be able to save the video if the user is offline, and upload it when connected to internet.
I can create the video file with the plugin image_picker, I tried to save it to the users gallery using plugin image_picker_saver but that seems to only handle images.
So I will probably have to use something like path_provider to save it to local storage (again examples of writing files are images as byte data)
When connected is there a way to upload a video to a Youtube account ?
I have read up on some Youtube plugins, but they are geared towards playing videos.
I was thinking of using WebViews to pop up the m.youtube.com/upload page but once you start an upload it goes to the desktop www.youtube.com
Other option to consider is using Firestore as the upload destination when they have a connection, but I would still have to manage offline local storage.
Thank you any help
Edit RE: comments below
Here is what I get when trying to capture a Landscape video on iPhone X with camera plugin:

Flutter Images and Video Saved using path_provider not showing in Gallery

I want to record a video or audio in my Flutter App and wants it to appear in gallery. How can I do it because path_provider is saving file to safe location and one need a rooted device to access it.
I was trying Flutter Camera Plugin Example
Also asked on https://github.com/flutter/flutter/issues/20807
The reason I was facing the problem is that the example I was trying uses path_provider function "getApplicationDocumentsDirectory()" to store the files.
By replacing above Function with "getExternalStorageDirectory()" I am able to store the file in the external directory and they appear in the Gallery.
You need to do scan media files using broadcast intent.
sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.fromFile(YOUR_PATH)));

downloading a movie file and placing it in the Videos directory... is that possible

I want to programattically pull a movie file down into a NSData object and write it to iPhone disk in the movies directory so that the user can open up their iPhone iPod section and watch the movies from there... Is that possible?
Or do I need within my app to create a 'viewing' area, download the files to NSHomeDirectory add a folder in Documents and store the data there?
Thanks for any answers...
Assuming an iPhone Store application, this is not do-able, as the Movie directory is not accessible to the sandboxed application.
Of course, you're free to download the movie to a location accessible to your application, and playing the movie inside your application.