Skip to content

Commit 96ee8a0

Browse files
authored
Merge pull request #32 from Shobbak/docs/update
Docs/update
2 parents dd5c106 + 4a571b7 commit 96ee8a0

File tree

5 files changed

+41
-23
lines changed

5 files changed

+41
-23
lines changed

README.md

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
# react-native-compressor
22

3-
react-native-compressor package is a set of functions that allow you compress `Image`,`Audio` and `Video`
3+
<!-- Title -->
4+
<p align="center">
5+
<img src="/media/icon.png" alt="alt text" width="150"/>
6+
</p>
7+
8+
<!-- Header -->
9+
10+
<p align="center">
11+
<b>Compress videos, images and audio before upload</b>
12+
<br />
13+
</p>
14+
15+
<p align="center">
16+
<img height="450" src="/media/cover.png">
17+
</p>
18+
19+
**react-native-compressor** package is a set of functions that allow you compress `Image`,`Audio` and `Video`
420

521
## Installation
622

@@ -81,17 +97,6 @@ const result = await Image.compress('file://path_of_file/image.jpg', {
8197
});
8298
```
8399

84-
### Audio
85-
86-
```js
87-
import { Audio } from 'react-native-compressor';
88-
89-
const result = await Audio.compress(
90-
'file://path_of_file/file_example_MP3_2MG.mp3',
91-
{ quality: 'medium' }
92-
);
93-
```
94-
95100
### Video
96101

97102
##### For Like Whatsapp Video Compression
@@ -134,6 +139,17 @@ const result = await Video.compress(
134139
);
135140
```
136141

142+
### Audio
143+
144+
```js
145+
import { Audio } from 'react-native-compressor';
146+
147+
const result = await Audio.compress(
148+
'file://path_of_file/file_example_MP3_2MG.mp3',
149+
{ quality: 'medium' }
150+
);
151+
```
152+
137153
# API
138154

139155
## Image
@@ -173,15 +189,6 @@ const result = await Video.compress(
173189
- ###### `returnableOutputType: ReturnableOutputType` (default: uri)
174190
Can be either `uri` or `base64`, defines the Returnable output image format.
175191

176-
## Audio
177-
178-
- ###### `compress(url: string, options?: audioCompresssionType): Promise<string>`
179-
180-
### audioCompresssionType
181-
182-
- ###### `quality: qualityType` (default: medium)
183-
we can also control bitrate through quality. qualityType can be `low` | `medium` | `high`
184-
185192
## Video
186193

187194
- ###### `compress(url: string, options?: videoCompresssionType , onProgress?: (progress: number)): Promise<string>`
@@ -199,6 +206,17 @@ const result = await Video.compress(
199206
- ###### `bitrate: string`
200207
bitrate of video which reduce or increase video size. if compressionMethod will auto then this prop will not work
201208

209+
## Audio
210+
211+
- ###### `compress(url: string, options?: audioCompresssionType): Promise<string>`
212+
213+
### audioCompresssionType
214+
215+
- ###### `quality: qualityType` (default: medium)
216+
we can also control bitrate through quality. qualityType can be `low` | `medium` | `high`
217+
218+
**Note: Audio compression will be add soon**
219+
202220
## Contributing
203221

204222
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ buildscript {
22
if (project == rootProject) {
33
repositories {
44
google()
5-
jcenter()
5+
mavenCentral()
66
}
77

88
dependencies {

media/cover.png

294 KB
Loading

media/icon.png

13.6 KB
Loading

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-compressor",
3-
"version": "0.5.2",
3+
"version": "0.5.3-rc.0",
44
"description": "This library compress image, video and audio",
55
"main": "lib/commonjs/index",
66
"module": "lib/module/index",

0 commit comments

Comments
 (0)