react-native-compressor 1.8.5 → 1.8.7
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 +5 -4
- package/android/build.gradle +3 -1
- package/android/src/main/java/com/reactnativecompressor/Audio/AudioCompressor.kt +202 -496
- package/android/src/main/java/com/reactnativecompressor/Audio/AudioExtractor.kt +112 -0
- package/android/src/main/java/com/reactnativecompressor/Audio/AudioHelper.kt +23 -0
- package/android/src/main/java/com/reactnativecompressor/Audio/AudioMain.kt +5 -13
- package/android/src/main/java/com/reactnativecompressor/Utils/RealPathUtil.kt +74 -8
- package/android/src/main/java/com/reactnativecompressor/Utils/Utils.kt +5 -0
- package/lib/commonjs/Audio/index.js +3 -42
- package/lib/commonjs/Audio/index.js.map +1 -1
- package/lib/commonjs/utils/index.js +5 -44
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/module/Audio/index.js +4 -43
- package/lib/module/Audio/index.js.map +1 -1
- package/lib/module/utils/index.js +5 -39
- package/lib/module/utils/index.js.map +1 -1
- package/lib/typescript/Audio/index.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +1 -1
- package/lib/typescript/utils/index.d.ts +1 -6
- package/lib/typescript/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Audio/index.tsx +5 -56
- package/src/utils/index.tsx +4 -54
package/README.md
CHANGED
|
@@ -267,7 +267,7 @@ Video.cancelCompression(cancellationVideoId);
|
|
|
267
267
|
import { Audio } from 'react-native-compressor';
|
|
268
268
|
|
|
269
269
|
const result = await Audio.compress(
|
|
270
|
-
'file://path_of_file/file_example_MP3_2MG.
|
|
270
|
+
'file://path_of_file/file_example_MP3_2MG.wav', // recommended wav file but can be use mp3 file
|
|
271
271
|
{ quality: 'medium' }
|
|
272
272
|
);
|
|
273
273
|
```
|
|
@@ -395,13 +395,14 @@ await clearCache(); // this will clear cache of thumbnails cache directory
|
|
|
395
395
|
## Audio
|
|
396
396
|
|
|
397
397
|
- ###### `compress(url: string, options?: audioCompresssionType): Promise<string>`
|
|
398
|
+
Android: recommended to use `wav` file as we convert mp3 to wav then apply bitrate
|
|
398
399
|
|
|
399
400
|
### audioCompresssionType
|
|
400
401
|
|
|
401
402
|
- ###### `quality: qualityType` (default: medium)
|
|
402
403
|
we can also control bitrate through quality. qualityType can be `low` | `medium` | `high`
|
|
403
404
|
|
|
404
|
-
**Note:
|
|
405
|
+
**Note: manual bitrate, samplerate etc will add soon**
|
|
405
406
|
|
|
406
407
|
## Background Upload
|
|
407
408
|
|
|
@@ -415,8 +416,8 @@ type FileSystemUploadOptions = (
|
|
|
415
416
|
uploadType?: FileSystemUploadType.BINARY_CONTENT,
|
|
416
417
|
}
|
|
417
418
|
| {
|
|
418
|
-
uploadType: FileSystemUploadType.MULTIPART,
|
|
419
|
-
fieldName?: string,
|
|
419
|
+
uploadType: FileSystemUploadType.MULTIPART, // will add soon
|
|
420
|
+
fieldName?: string, // will add soon
|
|
420
421
|
mimeType?: string,
|
|
421
422
|
parameters?: Record<string, string>,
|
|
422
423
|
}
|
package/android/build.gradle
CHANGED
|
@@ -100,6 +100,7 @@ android {
|
|
|
100
100
|
repositories {
|
|
101
101
|
mavenCentral()
|
|
102
102
|
google()
|
|
103
|
+
maven { url "https://jitpack.io" }
|
|
103
104
|
}
|
|
104
105
|
|
|
105
106
|
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
@@ -115,7 +116,8 @@ dependencies {
|
|
|
115
116
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4"
|
|
116
117
|
implementation "com.googlecode.mp4parser:isoparser:1.0.6"
|
|
117
118
|
|
|
118
|
-
implementation '
|
|
119
|
+
implementation 'com.github.banketree:AndroidLame-kotlin:v0.0.1'
|
|
120
|
+
implementation 'javazoom:jlayer:1.0.1'
|
|
119
121
|
}
|
|
120
122
|
|
|
121
123
|
if (isNewArchitectureEnabled()) {
|