Skip to content

Commit 620d297

Browse files
olivier-landoThibaultBee
authored andcommitted
Update documentation & bump version
1 parent eb8eeb2 commit 620d297

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Changelog
22
All changes to this project will be documented in this file.
33

4+
## [1.2.0] - 2024-04-03
5+
- Add support of progressive uploads
6+
47
## [1.1.0] - 2024-02-16
58
- Add support for RN new architecture: Turbo Native Modules
69
- Add an API to set time out

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
- [Getting started](#getting-started)
1515
- [Installation](#installation)
1616
- [Code sample](#code-sample)
17+
- [Regular upload](#regular-upload)
18+
- [Progressive upload](#progressive-upload)
1719
- [Android](#android)
1820
- [Permissions](#permissions)
1921
- [Notifications](#notifications)
@@ -54,6 +56,8 @@ yarn add @api.video/react-native-video-uploader
5456

5557
### Code sample
5658

59+
#### Regular upload
60+
5761
```js
5862
import ApiVideoUploader from '@api.video/react-native-video-uploader';
5963

@@ -66,6 +70,27 @@ ApiVideoUploader.uploadWithUploadToken('YOUR_UPLOAD_TOKEN', 'path/to/my-video.mp
6670
});
6771
```
6872

73+
#### Progressive upload
74+
75+
For more details about progressive uploads, see the [progressive upload documentation](https://docs.api.video/vod/progressive-upload).
76+
77+
```js
78+
import ApiVideoUploader from '@api.video/react-native-video-uploader';
79+
80+
(async () => {
81+
const uploadSession = ApiVideoUploader.createProgressiveUploadSession({token: 'YOUR_UPLOAD_TOKEN'});
82+
try {
83+
await session.uploadPart("path/to/video.mp4.part1");
84+
await session.uploadPart("path/to/video.mp4.part2");
85+
// ...
86+
const video = await session.uploadLastPart("path/to/video.mp4.partn");
87+
// ...
88+
} catch(e: any) {
89+
// Manages error here
90+
}
91+
})();
92+
```
93+
6994
### Android
7095

7196
#### Permissions

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@api.video/react-native-video-uploader",
3-
"version": "1.1.0",
3+
"version": "1.2.0",
44
"description": "The official React Native video uploader for api.video",
55
"main": "lib/commonjs/index",
66
"module": "lib/module/index",

0 commit comments

Comments
 (0)