react-native-compressor 1.5.2 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -32
- package/android/build.gradle +5 -5
- package/android/src/main/java/com/reactnativecompressor/CompressorModule.java +2 -0
- package/package.json +1 -1
- package/android/.DS_Store +0 -0
- package/android/.idea/.gitignore +0 -3
- package/android/src/.DS_Store +0 -0
- package/android/src/main/.DS_Store +0 -0
- package/android/src/main/java/.DS_Store +0 -0
- package/android/src/main/java/com/.DS_Store +0 -0
- package/android/src/main/java/com/reactnativecompressor/.DS_Store +0 -0
- package/android/src/main/java/com/reactnativecompressor/Utils/.DS_Store +0 -0
- package/android/src/main/java/com/reactnativecompressor/Video/.DS_Store +0 -0
- package/android/src/main/java/com/reactnativecompressor/Video/AutoVideoCompression/.DS_Store +0 -0
- package/ios/.DS_Store +0 -0
- package/ios/Image/.DS_Store +0 -0
- package/ios/Video/.DS_Store +0 -0
package/README.md
CHANGED
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
### Would you like to support me?
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
|
-
<a href="https://github.com/
|
|
5
|
-
<img src="https://img.shields.io/github/followers/
|
|
4
|
+
<a href="https://github.com/numandev1?tab=followers">
|
|
5
|
+
<img src="https://img.shields.io/github/followers/numandev1?label=Follow%20%40numandev1&style=social" height="36" />
|
|
6
6
|
</a>
|
|
7
|
+
<a href="https://www.youtube.com/channel/UCYCUspfN7ZevgCj3W5GlFAw"><img src="https://img.shields.io/youtube/channel/subscribers/UCYCUspfN7ZevgCj3W5GlFAw?style=social" height="36" /><a/>
|
|
7
8
|
</br>
|
|
8
9
|
<a href="https://www.buymeacoffee.com/numan.dev" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a>
|
|
9
10
|
</div>
|
|
10
11
|
|
|
11
12
|
---
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
14
|
# react-native-compressor
|
|
16
15
|
|
|
17
|
-
<!-- Title -->
|
|
18
|
-
<p align="center">
|
|
19
|
-
<img src="/media/icon.png" alt="alt text" width="150"/>
|
|
20
|
-
</p>
|
|
21
|
-
|
|
22
16
|
<!-- Header -->
|
|
23
17
|
|
|
24
18
|
<p align="center">
|
|
@@ -35,32 +29,34 @@
|
|
|
35
29
|
**If you find this package useful hit the star** 🌟
|
|
36
30
|
|
|
37
31
|
# Table of Contents
|
|
32
|
+
|
|
38
33
|
<details>
|
|
39
34
|
<summary>Open Table of Contents</summary>
|
|
40
35
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
36
|
+
- [Installation](#installation)
|
|
37
|
+
- [For React Native](#react-native)
|
|
38
|
+
- [For React Native<0.65](#for-react-native065)
|
|
39
|
+
- [For React Native 0.65 or greater](#for-react-native-065-or-greater)
|
|
40
|
+
- [Managed Expo](#managed-expo)
|
|
41
|
+
- [Usage](#usage)
|
|
42
|
+
- [Image](#image)
|
|
43
|
+
- [Automatic Image Compression Like Whatsapp](#automatic-image-compression-like-whatsapp)
|
|
44
|
+
- [Manual Image Compression](#manual-image-compression)
|
|
45
|
+
- [ImageCompressor API Docs](#imagecompressor)
|
|
46
|
+
- [Video](#video)
|
|
47
|
+
- [Automatic Video Compression Like Whatsapp](#automatic-video-compression-like-whatsapp)
|
|
48
|
+
- [Manual Video Compression](#manual-video-compression)
|
|
49
|
+
- [Cancel Video Compression](#cancel-video-compression)
|
|
50
|
+
- [Video Api Docs](#video-1)
|
|
51
|
+
- [Audio](#audio)
|
|
52
|
+
- [Background Upload](#background-upload)
|
|
53
|
+
|
|
54
|
+
* [Other Utilities](#api)
|
|
55
|
+
- [Background Upload](#background-upload-1)
|
|
56
|
+
- [Get Metadata Of Video](#get-metadata-of-video)
|
|
57
|
+
- [Get Real Path](#get-real-path)
|
|
58
|
+
- [Get Temp file Path](#get-temp-file-path)
|
|
59
|
+
</details>
|
|
64
60
|
|
|
65
61
|
## Installation
|
|
66
62
|
|
package/android/build.gradle
CHANGED
|
@@ -18,11 +18,11 @@ def safeExtGet(prop, fallback) {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
android {
|
|
21
|
-
compileSdkVersion safeExtGet('
|
|
22
|
-
buildToolsVersion safeExtGet('
|
|
21
|
+
compileSdkVersion safeExtGet('compileSdkVersion', 29)
|
|
22
|
+
buildToolsVersion safeExtGet('buildToolsVersion', '29.0.2')
|
|
23
23
|
defaultConfig {
|
|
24
|
-
minSdkVersion safeExtGet('
|
|
25
|
-
targetSdkVersion safeExtGet('
|
|
24
|
+
minSdkVersion safeExtGet('minSdkVersion', 16)
|
|
25
|
+
targetSdkVersion safeExtGet('targetSdkVersion', 29)
|
|
26
26
|
versionCode 1
|
|
27
27
|
versionName "1.0"
|
|
28
28
|
|
|
@@ -57,6 +57,6 @@ dependencies {
|
|
|
57
57
|
//noinspection GradleDynamicVersion
|
|
58
58
|
implementation "com.facebook.react:react-native:+" // From node_modules
|
|
59
59
|
implementation 'io.github.lizhangqu:coreprogress:1.0.2'
|
|
60
|
-
implementation 'com.github.
|
|
60
|
+
implementation 'com.github.numandev1:VideoCompressor:715bcc16e9'
|
|
61
61
|
// implementation project(path: ':videocompressor')
|
|
62
62
|
}
|
|
@@ -137,6 +137,7 @@ public class CompressorModule extends ReactContextBaseJavaModule {
|
|
|
137
137
|
int actualHeight =Integer.parseInt(metaRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT));
|
|
138
138
|
int actualWidth = Integer.parseInt(metaRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_WIDTH));
|
|
139
139
|
long duration = Long.parseLong(metaRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION));
|
|
140
|
+
String creationTime = metaRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DATE)
|
|
140
141
|
String extension = filePath.substring(filePath.lastIndexOf(".")+1);
|
|
141
142
|
|
|
142
143
|
WritableMap params = Arguments.createMap();
|
|
@@ -145,6 +146,7 @@ public class CompressorModule extends ReactContextBaseJavaModule {
|
|
|
145
146
|
params.putString("height", String.valueOf(actualHeight));
|
|
146
147
|
params.putString("duration", String.valueOf(duration/1000));
|
|
147
148
|
params.putString("extension", extension);
|
|
149
|
+
params.putString("creationTime", String.valueOf(creationTime));
|
|
148
150
|
|
|
149
151
|
promise.resolve(params);
|
|
150
152
|
} catch (Exception e) {
|
package/package.json
CHANGED
package/android/.DS_Store
DELETED
|
Binary file
|
package/android/.idea/.gitignore
DELETED
package/android/src/.DS_Store
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/src/main/java/com/reactnativecompressor/Video/AutoVideoCompression/.DS_Store
DELETED
|
Binary file
|
package/ios/.DS_Store
DELETED
|
Binary file
|
package/ios/Image/.DS_Store
DELETED
|
Binary file
|
package/ios/Video/.DS_Store
DELETED
|
Binary file
|