From 06049f864ce14c7d4b58ef889bb403e38c9a9c8a Mon Sep 17 00:00:00 2001 From: Olivier Lando Date: Wed, 3 Apr 2024 16:48:35 +0200 Subject: [PATCH] Update documentation & bump version --- CHANGELOG.md | 3 +++ README.md | 24 ++++++++++++++++++++++++ package.json | 2 +- 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67a5681..a9897ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index c360dd5..ff1629c 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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'; @@ -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 diff --git a/package.json b/package.json index 7c15f74..638434a 100644 --- a/package.json +++ b/package.json @@ -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",