Video saving into Picture folder
Did you check the documentation and it did not help?
- [X] I have read the README
- [X] I have searched the existing documentation
- [X] I have searched the existing answer
- [X] I have read the contribution guide
When I am saving video with an album name (e.g. await Gal.putVideo(tmpVideoPath.path, album: 'Intro Maker');) the video saving into 'Picture/Intro Maker' directory.
My phone is a Galaxy s8, android v10 (Custom ROM).
We cannot respond until the DESCRIPTION item is filled
This behavior is currently as intended.
What I will give in the description?
Now I have checked your inner code. In native you called same for both video and image
GalPlugin.java (line63)
switch (call.method) { case "putVideo": case "putImage": { new Thread(() -> { try {
And in the createContentValues method The condition Is (I think not right).
GalPlugin.java (line167)
private ContentValues createContentValues(boolean isImage, String name, String extension,
String album) {
ContentValues values = new ContentValues();
String dirPath = isImage || album != null ? Environment.DIRECTORY_PICTURES
: Environment.DIRECTORY_MOVIES;
......
Here set Environment.DIRECTORY_PICTURES if album null. But I have passed album value
What I will give in the description?
Simply fill in the items as per the template. You have erased it and it is no longer visible.
Now I have commented. Please check
When specifying a custom album, it is intended that it be created under Picture. I don't remember, but I think there was a reason it couldn't be created under Videoπ€
After removing the album != null from the createContentValues method, The video has been saved in the 'Movies/Intro Maker' directory. So I think it is possible
And it is not good practice to use your code by changing on my side as there could be more conditions I don't know.
So please handle it
One thing I just remembered. I believe that this will result in a behavior that is not as intended for many people.
For example, when you save a file with the folder name MyFolder, if you save it in Pictures for images and Movies for videos, two folders named MyFolder will be created. @Riz1ahmed
Any update? Same issue with android 13, Samsung Galaxy A71. await Gal.putVideo(filePath, album: 'MyAlbum');. MyAlbum saved in Pictures instead of Movies and the video does not show in the Gallery.
As you can see from the thread above, this behavior is intentional and will not be changed. And this issue will be closed soon as there has been no reply from the author.
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. If you find this problem please file a new issue with the same description, Thanks for your contribution.
Solved by: I imported the library as a local into my project. And removed the '|| album != null' (from GalPlugin.java:172).
Yes. This change is not intentional for many people and should be made privately.
I don't understand why many people would want the video to be saved in the Pictures directory.
Read the thread to find out. Let's say you are developing a camera app and you want to have a directory for your app. If you create separate directories depending on whether it was a photo or a video that was taken, users will be confused.
And there is no motivation to work on this issue unless there is a clear answer regarding the π problem.
For cases like this (e.g., a camera app), there should be a boolean variable isSingleDir. If false, a separate folder should be created. If true, there are two possible solutions:
- The folder could be created inside the Camera (DCIM) folder, where all the images and videos from the camera app will be saved.
- The folder could be created in the storage root directory (not inside the Pictures folder) with the specified name.
Alternatively, there might be other solutions, but saving videos in the Pictures folder doesn't seem like the right approach.
I cannot support that approach because it is not aesthetic. And we need to know the use case in more detail: do you want to create your own album in the Movie folder? And your app only stores videos?
Yes. My app now creates only videos (an image feature could be added in the future). I need to save the video inside the user's video directory (Videos/Movies).
For anyone that came across this issue, you can use my fork https://github.com/Andrew-Bekhiet/gal
I've added support for saving videos to Movies directory with backward compatibility with older versions of the plugin Keep in mind that I only implemented the change on Android and Windows but not darwin platform as I'm not sure how it works on Apple devices and I tested only on android Any feedback or PRs are welcome π€
We are developers, we build software to help users achieve their goals πͺπ»
Thank you very much. I am looking for a clean approach on this issue, but currently no quality ideas exist that can be merged into the main branch.
My goal is to make this plugin simple and easy to use for many people, and most importantly, it needs to be supported in the long term. For this reason, I may be cautious about adding features. Thank you for your understanding.
I think You should have a switch like "UseMovieFolderForVideoAlbums" to some users could switch it on.