react-native-compressor 1.6.2 → 1.6.4
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
CHANGED
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
|
|
2
|
+
<img height="150" src="/media/logo.png"></h2>
|
|
3
3
|
</div>
|
|
4
|
+
<br/>
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
<div align="center">
|
|
7
|
+
|
|
8
|
+
[](https://discord.gg/dtYzk8sp)
|
|
9
|
+
[](https://github.com/numandev1/react-native-compressor/stargazers)
|
|
10
|
+
[](https://www.npmjs.com/package/react-native-compressor)
|
|
11
|
+

|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
**REACT-NATIVE-COMPRESSOR** is a react-native package, which help us to Compress `Image`, `Video`, and `Audio` same like **Whatsapp** without knowing compression `algorithm`
|
|
17
|
+
|
|
18
|
+
<div align="center">
|
|
19
|
+
<img height="60" src="/media/whatsapp_logo.png">
|
|
20
|
+
<h2 align="center">🗜️Compress Image, Video, and Audio same like Whatsapp</h2>
|
|
21
|
+
</div>
|
|
6
22
|
|
|
7
|
-
|
|
23
|
+
#### Why should we use react-native-compress over [FFmpeg](https://www.ffmpeg.org/)?
|
|
24
|
+
|
|
25
|
+
We should use **react-native-compressor** instead of **FFmpeg** because **react-native-compressor** gives you same compression of **Whatsapp** (`Image, Video, and Audio`) without knowing the algorithm of compression + it is lightweight only increase **50 KB Size** Size in APK while **FFmpeg** increase ~> **9 MB Size** in **APK**, and we have to give manual image/video/Audo size and quality as well as
|
|
26
|
+
|
|
27
|
+
**If you find this package useful hit the star** 🌟
|
|
8
28
|
|
|
9
29
|
### Would you like to support me?
|
|
10
30
|
|
|
@@ -22,23 +42,7 @@ We should use **react-native-compressor** instead of **FFmpeg** because **react-
|
|
|
22
42
|
|
|
23
43
|
---
|
|
24
44
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<p align="center">
|
|
28
|
-
<h1>Banchmark between <img height="50" src="/media/whatsapp_logo.png"> VS REACT-NATIVE-COMPRESSOR</h1>
|
|
29
|
-
<br />
|
|
30
|
-
</p>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<p align="center">
|
|
34
|
-
<img height="450" src="/media/branchmark_for_images.png">
|
|
35
|
-
<br /> <br />
|
|
36
|
-
<img height="450" src="/media/benchmark_for_videos.png">
|
|
37
|
-
</p>
|
|
38
|
-
|
|
39
|
-
**react-native-compressor** package is a set of functions that allow you compress `Image`,`Audio` and `Video`
|
|
40
|
-
|
|
41
|
-
**If you find this package useful hit the star** 🌟
|
|
45
|
+
#### See the [Benchmarks](#benchmark)
|
|
42
46
|
|
|
43
47
|
# Table of Contents
|
|
44
48
|
|
|
@@ -429,6 +433,16 @@ const randomFilePathForSaveFile = await generateFilePath('mp4'); // file://fil
|
|
|
429
433
|
|
|
430
434
|
- ##### `generateFilePath(fileextension: string)`
|
|
431
435
|
|
|
436
|
+
## Benchmark
|
|
437
|
+
|
|
438
|
+
[<img height="30" src="/media/whatsapp_logo.png"> Whatsapp:](https://apps.apple.com/us/app/whatsapp-messenger/id310633997) compresses Images,Videos and Audios in every effect way
|
|
439
|
+
|
|
440
|
+
<p align="center">
|
|
441
|
+
<img height="450" src="/media/branchmark_for_images.png">
|
|
442
|
+
<br /> <br />
|
|
443
|
+
<img height="450" src="/media/benchmark_for_videos.png">
|
|
444
|
+
</p>
|
|
445
|
+
|
|
432
446
|
## Contributing
|
|
433
447
|
|
|
434
448
|
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
|
|
@@ -407,7 +407,7 @@ public class AudioCompressor {
|
|
|
407
407
|
return -1;
|
|
408
408
|
}
|
|
409
409
|
|
|
410
|
-
|
|
410
|
+
@SuppressLint("WrongConstant")
|
|
411
411
|
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
|
|
412
412
|
private long writeAudioTrack(MediaExtractor extractor, MediaMuxer mediaMuxer, MediaCodec.BufferInfo info, File file, int muxerTrackIndex ) throws Exception {
|
|
413
413
|
int trackIndex = selectTrack(extractor, true);
|