Manage video storage with StorageConfiguration
masterThe StorageConfiguration interface determines where the compressed video is saved. The library provides several built-in implementations:
1. AppSpecificStorageConfiguration
Saves the file in the app's private storage directory.
subFolderName: (Optional) A subfolder name within the app's specific storage.
2. SharedStorageConfiguration
Saves the file in public directories accessible by other apps.
saveAt: The directory to save in. Must be one of:SaveLocation.pictures,SaveLocation.movies, orSaveLocation.downloads. (Default ismovies).subFolderName: (Optional) A subfolder name within the shared directory.
3. CacheStorageConfiguration
Saves the file in the system-defined cache directory.
4. Custom Implementation
If none of the above fit, you can implement the StorageConfiguration interface yourself to define exactly how and where the file is created.
class FullyCustomizedStorageConfiguration(
) : StorageConfiguration {
override fun createFileToSave(
context: Context,
videoFile: File,
fileName: String,
shouldSave: Boolean
): File = ??? // Your custom logic
}