You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- **Breaking** `AppSpecificStorageConfiguration` can be passed to store the output video in Android's App Specific Storage.
- **Breaking** `SharedStorageConfiguration` can be passed to store the output video in Android's Primary Storage, it accepts storing at `pictures`, `downloads`, or `movies`.
- Only one of the configurations can be provided at a time, either `AppSpecificStorageConfiguration` or `SharedStorageConfiguration`.
Copy file name to clipboardExpand all lines: README.md
+33-66Lines changed: 33 additions & 66 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,15 @@ I would like to mention that the set attributes for size and quality worked just
14
14
15
15
**LightCompressor is now available in iOS**, have a look at [LightCompressor_iOS](https://github.com/AbedElazizShe/LightCompressor_iOS).
16
16
17
+
# Change Logs
18
+
19
+
## What's new in 1.2.3
20
+
21
+
-**Breaking**`StorageConfiguration` was removed.
22
+
-**Breaking**`AppSpecificStorageConfiguration` can be passed to store the output video in Android's App Specific Storage.
23
+
-**Breaking**`SharedStorageConfiguration` can be passed to store the output video in Android's Primary Storage, it accepts storing at `pictures`, `downloads`, or `movies`.
24
+
- Only one of the configurations can be provided at a time, either `AppSpecificStorageConfiguration` or `SharedStorageConfiguration`.
25
+
17
26
# What's new in 1.2.2
18
27
19
28
-**Breaking** videoBitrate was renamed to videoBitrateInMbps. It should be int.
@@ -55,7 +64,7 @@ when {
55
64
}
56
65
```
57
66
58
-
You can as well pass custom videoHeight, videoWidth, frameRate, and videoBitrate values if you don't want the library to auto-generate the values for you. **The compression will fail if height or width is specified without the other, so ensure you pass both values**.
67
+
You can as well pass custom videoHeight, videoWidth, and videoBitrate values if you don't want the library to auto-generate the values for you. **The compression will fail if height or width is specified without the other, so ensure you pass both values**.
59
68
60
69
These values were tested on a huge set of videos and worked fine and fast with them. They might be changed based on the project needs and expectations.
Then just call [VideoCompressor.start()] and pass context, uris, isStreamable, storageConfiguration, and configureWith.
119
+
Then just call [VideoCompressor.start()] and pass **context**, **uris**, **isStreamable**, **configureWith**, and either **sharedStorageConfiguration OR appSpecificStorageConfiguration**.
111
120
112
121
The method has a callback for 5 functions;
113
122
1) OnStart - called when compression started
@@ -121,6 +130,7 @@ The method has a callback for 5 functions;
121
130
- All the callback functions returns an index for the video being compressed in the same order of the urls passed to the library. You can use this index to update the UI
122
131
or retrieve information about the original uri/file.
123
132
- The source video must be provided as a list of content uris.
133
+
- OnSuccess returns the path of the stored video.
124
134
- If you want an output video that is optimised to be streamed, ensure you pass [isStreamable] flag is true.
125
135
126
136
### Configuration values
@@ -139,13 +149,18 @@ or retrieve information about the original uri/file.
- subFolderName: a subfolder name created in app's specific storage. The library won't create the subfolder and will throw an exception if the subfolder does not exist.
143
157
144
-
- fileName: a custom name for the output video. If ignored, the library will assign a name that is a combination of the video original name with a timestamp.
145
158
146
-
- isExternal: if passed as false, the video will be saved at app-specific file directory.
- saveAt: the directory where the video should be saved in. The value will be ignored if isExternal is false.
161
+
- videoName: a custom name for the output video.
162
+
163
+
- saveAt: the directory where the video should be saved in. Must be one of the following; [SaveLocation.pictures], [SaveLocation.movies], or [SaveLocation.downloads].
149
164
150
165
151
166
To cancel the compression job, just call [VideoCompressor.cancel()]
@@ -156,12 +171,17 @@ To cancel the compression job, just call [VideoCompressor.cancel()]
156
171
VideoCompressor.start(
157
172
context = applicationContext, // => This is required
158
173
uris =List<Uri>, // => Source can be provided as content uris
159
-
isStreamable =true,
160
-
storageConfiguration =StorageConfiguration(
161
-
saveAt =Environment.DIRECTORY_MOVIES, // => the directory to save the compressed video(s). Will be ignored if isExternal = false.
162
-
isExternal =true, // => false means save at app-specific file directory. Default is true.
163
-
fileName ="output-video.mp4"// => an optional value for a custom video name.
@@ -263,7 +230,7 @@ from within the main thread. Have a look at the example code above for more info
263
230
To report an issue, please specify the following:
264
231
- Device name
265
232
- Android version
266
-
- If the bug/issue exists on the sample app (version 1.2.2) of the library that could be downloaded at this [link](https://drive.google.com/file/d/1GXblLAg1hnCa0Ef79iweQGvn1rLOYph8/view?usp=share_link).
233
+
- If the bug/issue exists on the sample app (version 1.2.3) of the library that could be downloaded at this [link](https://drive.google.com/file/d/1WZtHN8gG2TaDuuTDKi9wB3B_sT_0SJ4w/view?usp=share_link).
267
234
268
235
## Compatibility
269
236
Minimum Android SDK: LightCompressor requires a minimum API level of 21.
@@ -293,7 +260,7 @@ Include this in your Module-level build.gradle file:
0 commit comments