Skip to content

Commit

Permalink
Update documentation & bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierapivideo authored and ThibaultBee committed Apr 3, 2024
1 parent eb8eeb2 commit 06049f8
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog
All changes to this project will be documented in this file.

## [1.2.0] - 2024-04-03
- Add support of progressive uploads

## [1.1.0] - 2024-02-16
- Add support for RN new architecture: Turbo Native Modules
- Add an API to set time out
Expand Down
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
- [Getting started](#getting-started)
- [Installation](#installation)
- [Code sample](#code-sample)
- [Standard upload](#standard-upload)
- [Progressive upload](#progressive-upload)
- [Android](#android)
- [Permissions](#permissions)
- [Notifications](#notifications)
Expand Down Expand Up @@ -54,6 +56,7 @@ yarn add @api.video/react-native-video-uploader

### Code sample

#### Standard upload
```js
import ApiVideoUploader from '@api.video/react-native-video-uploader';

Expand All @@ -66,6 +69,27 @@ ApiVideoUploader.uploadWithUploadToken('YOUR_UPLOAD_TOKEN', 'path/to/my-video.mp
});
```

#### Progressive upload

For more details about progressive uploads, see the [progressive upload documentation](https://docs.api.video/vod/progressive-upload).

```js
import ApiVideoUploader from '@api.video/react-native-video-uploader';

(async () => {
const uploadSession = ApiVideoUploader.createProgressiveUploadSession({token: 'YOUR_UPLOAD_TOKEN'});
try {
await session.uploadPart("path/to/video.mp4.part1");
await session.uploadPart("path/to/video.mp4.part2");
// ...
const video = await session.uploadLastPart("path/to/video.mp4.partn");
// ...
} catch(e: any) {
// Manages error here
}
})();
```

### Android

#### Permissions
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@api.video/react-native-video-uploader",
"version": "1.1.0",
"version": "1.2.0",
"description": "The official React Native video uploader for api.video",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down

0 comments on commit 06049f8

Please sign in to comment.