Skip to content

Commit 5f1c4bf

Browse files
authored
feat(swift5): use Basic auth instead of Bearer
1 parent f569406 commit 5f1c4bf

File tree

1 file changed

+44
-62
lines changed

1 file changed

+44
-62
lines changed

README.md

Lines changed: 44 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
<!--<documentation_excluded>-->
21
[![badge](https://img.shields.io/twitter/follow/api_video?style=social)](https://twitter.com/intent/follow?screen_name=api_video) &nbsp; [![badge](https://img.shields.io/github/stars/apivideo/api.video-android-uploader?style=social)](https://github.com/apivideo/api.video-android-uploader) &nbsp; [![badge](https://img.shields.io/discourse/topics?server=https%3A%2F%2Fcommunity.api.video)](https://community.api.video)
32
![](https://github.com/apivideo/.github/blob/main/assets/apivideo_banner.png)
43
<h1 align="center">api.video Android uploader</h1>
54

65
[api.video](https://api.video) is the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and managing on-demand & low latency live streaming features in your app.
76

8-
## Table of contents
7+
# Table of contents
98

10-
- [Table of contents](#table-of-contents)
119
- [Project description](#project-description)
1210
- [Getting started](#getting-started)
1311
- [Requirements](#requirements)
@@ -16,50 +14,34 @@
1614
- [Gradle users](#gradle-users)
1715
- [Others](#others)
1816
- [Code sample](#code-sample)
19-
- [Example](#example)
20-
- [Upload methods](#upload-methods)
17+
- [Upload options](#upload-options)
2118
- [Permissions](#permissions)
2219
- [Documentation](#documentation)
2320
- [API Endpoints](#api-endpoints)
2421
- [VideosApi](#videosapi)
25-
- [Retrieve an instance of VideosApi:](#retrieve-an-instance-of-videosapi)
26-
- [Endpoints](#endpoints)
27-
- [Documentation for Models](#documentation-for-models)
28-
- [Documentation for Authorization](#documentation-for-authorization)
22+
- [Models](#models)
23+
- [Authorization](#documentation-for-authorization)
2924
- [API key](#api-key)
3025
- [Public endpoints](#public-endpoints)
3126
- [Recommendation](#recommendation)
32-
- [Have you gotten use from this API client?](#have-you-gotten-use-from-this-api-client)
27+
- [Have you gotten use from this API client?](#have-you-gotten-use-from-this-api-client-)
3328
- [Contribution](#contribution)
3429

35-
<!--</documentation_excluded>-->
36-
<!--<documentation_only>
37-
---
38-
title: api.video Android video uploader
39-
meta:
40-
description: The official api.video Android video uploader for api.video. [api.video](https://api.video/) is the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and managing on-demand & low latency live streaming features in your app.
41-
---
42-
43-
# api.video Android video uploader
44-
45-
[api.video](https://api.video/) is the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and managing on-demand & low latency live streaming features in your app.
46-
47-
</documentation_only>-->
48-
## Project description
30+
# Project description
4931

5032
api.video's Android streamlines the coding process. Chunking files is handled for you, as is pagination and refreshing your tokens.
5133

52-
## Getting started
34+
# Getting started
5335

54-
### Requirements
36+
## Requirements
5537

5638
Building the API client library requires:
5739
1. Java 1.8+
5840
2. Maven/Gradle
5941

60-
### Installation
42+
## Installation
6143

62-
#### Maven users
44+
### Maven users
6345

6446
Add this dependency to your project's POM:
6547

@@ -72,15 +54,15 @@ Add this dependency to your project's POM:
7254
</dependency>
7355
```
7456

75-
#### Gradle users
57+
### Gradle users
7658

7759
Add this dependency to your project's build file:
7860

7961
```groovy
8062
implementation "video.api:android-video-uploader:1.3.2"
8163
```
8264

83-
#### Others
65+
### Others
8466

8567
At first generate the JAR by executing:
8668

@@ -93,7 +75,7 @@ Then manually install the following JARs:
9375
* `target/android-video-uploader-1.3.2.jar`
9476
* `target/lib/*.jar`
9577

96-
### Code sample
78+
## Code sample
9779

9880
Please follow the [installation](#installation) instruction and execute the following Kotlin code:
9981

@@ -109,18 +91,18 @@ val workManager = WorkManager.getInstance(context) // WorkManager comes from pac
10991
workManager.uploadWithUploadToken("MY_UPLOAD_TOKEN", myVideoFile) // Dispatch the upload with the WorkManager
11092
```
11193

112-
#### Example
94+
### Example
11395

11496
Examples that demonstrate how to use the API is provided in folder `examples/`.
11597

116-
### Upload methods
98+
## Upload methods
11799

118100
To upload a video, you have 3 differents methods:
119-
* `WorkManager`: preferred method: Upload with Android WorkManager API. It supports progress notifications, upload in background, queue, reupload after lost connections. Directly use, WorkManager extensions. See [example](https://github.com/apivideo/api.video-android-uploader/tree/main/examples/workmanager) for more details.
120-
* `UploadService`: Upload with an Android Service. It supports progress notifications, upload in background, queue. You have to extend the `UploadService` and register it in your `AndroidManifest.xml`. See [examples/service](https://github.com/apivideo/api.video-android-uploader/tree/main/examples/service) for more details.
101+
* `WorkManager`: preferred method: Upload with Android WorkManager API. It supports progress notifications, upload in background, queue, reupload after lost connections. Directly use, WorkManager extensions. See [example](examples/workmanager) for more details.
102+
* `UploadService`: Upload with an Android Service. It supports progress notifications, upload in background, queue. You have to extend the `UploadService` and register it in your `AndroidManifest.xml`. See [example](examples/service) for more details.
121103
* Direct call with `ApiClient`: Do not call API from the main thread, otherwise you will get an `android.os.NetworkOnMainThreadException`. Dispatch API calls with Thread, Executors or Kotlin coroutine to avoid this.
122104

123-
### Permissions
105+
## Permissions
124106

125107
You have to add the following permissions in your `AndroidManifest.xml`:
126108

@@ -132,51 +114,51 @@ You have to add the following permissions in your `AndroidManifest.xml`:
132114

133115
Your application also has to dynamically request the `android.permission.READ_EXTERNAL_STORAGE` permission to upload videos.
134116

135-
## Documentation
117+
# Documentation
136118

137-
### API Endpoints
119+
## API Endpoints
138120

139121
All URIs are relative to *https://ws.api.video*
140122

141123

142-
#### VideosApi
124+
### VideosApi
143125

144126

145-
##### Retrieve an instance of VideosApi:
127+
#### Retrieve an instance of VideosApi:
146128
```kotlin
147129
val videosApi = VideosApi("YOUR_API_KEY", Environment.PRODUCTION)
148130
```
149131

150132

151133

152-
##### Endpoints
134+
#### Endpoints
153135

154136
Method | HTTP request | Description
155137
------------- | ------------- | -------------
156-
[**upload**](https://github.com/apivideo/api.video-android-uploader/blob/main/docs/VideosApi.md#upload) | **POST** /videos/{videoId}/source | Upload a video
157-
[**uploadWithUploadToken**](https://github.com/apivideo/api.video-android-uploader/blob/main/docs/VideosApi.md#uploadWithUploadToken) | **POST** /upload | Upload with an delegated upload token
138+
[**upload**](docs/VideosApi.md#upload) | **POST** /videos/{videoId}/source | Upload a video
139+
[**uploadWithUploadToken**](docs/VideosApi.md#uploadWithUploadToken) | **POST** /upload | Upload with an delegated upload token
158140

159141

160142

161-
### Documentation for Models
143+
## Documentation for Models
162144

163-
- [AccessToken](https://github.com/apivideo/api.video-android-uploader/blob/main/docs/AccessToken.md)
164-
- [AdditionalBadRequestErrors](https://github.com/apivideo/api.video-android-uploader/blob/main/docs/AdditionalBadRequestErrors.md)
165-
- [AuthenticatePayload](https://github.com/apivideo/api.video-android-uploader/blob/main/docs/AuthenticatePayload.md)
166-
- [BadRequest](https://github.com/apivideo/api.video-android-uploader/blob/main/docs/BadRequest.md)
167-
- [Metadata](https://github.com/apivideo/api.video-android-uploader/blob/main/docs/Metadata.md)
168-
- [NotFound](https://github.com/apivideo/api.video-android-uploader/blob/main/docs/NotFound.md)
169-
- [RefreshTokenPayload](https://github.com/apivideo/api.video-android-uploader/blob/main/docs/RefreshTokenPayload.md)
170-
- [Video](https://github.com/apivideo/api.video-android-uploader/blob/main/docs/Video.md)
171-
- [VideoAssets](https://github.com/apivideo/api.video-android-uploader/blob/main/docs/VideoAssets.md)
172-
- [VideoSource](https://github.com/apivideo/api.video-android-uploader/blob/main/docs/VideoSource.md)
173-
- [VideoSourceLiveStream](https://github.com/apivideo/api.video-android-uploader/blob/main/docs/VideoSourceLiveStream.md)
174-
- [VideoSourceLiveStreamLink](https://github.com/apivideo/api.video-android-uploader/blob/main/docs/VideoSourceLiveStreamLink.md)
145+
- [AccessToken](docs/AccessToken.md)
146+
- [AdditionalBadRequestErrors](docs/AdditionalBadRequestErrors.md)
147+
- [AuthenticatePayload](docs/AuthenticatePayload.md)
148+
- [BadRequest](docs/BadRequest.md)
149+
- [Metadata](docs/Metadata.md)
150+
- [NotFound](docs/NotFound.md)
151+
- [RefreshTokenPayload](docs/RefreshTokenPayload.md)
152+
- [Video](docs/Video.md)
153+
- [VideoAssets](docs/VideoAssets.md)
154+
- [VideoSource](docs/VideoSource.md)
155+
- [VideoSourceLiveStream](docs/VideoSourceLiveStream.md)
156+
- [VideoSourceLiveStreamLink](docs/VideoSourceLiveStreamLink.md)
175157

176158

177-
### Documentation for Authorization
159+
## Documentation for Authorization
178160

179-
#### API key
161+
### API key
180162

181163
Most endpoints required to be authenticated using the API key mechanism described in our [documentation](https://docs.api.video/reference#authentication).
182164

@@ -185,24 +167,24 @@ Only the [Public endpoints](#public-endpoints) can be called without authenticat
185167
In the case, you want to call an endpoint that requires authentication, you will have to use a backend server. See [Security best practices](https://docs.api.video/sdks/security) for more details.
186168

187169

188-
#### Public endpoints
170+
### Public endpoints
189171

190172
Some endpoints don't require authentication. These one can be called with a client instantiated without API key:
191173
```kotlin
192174
val videosApi = VideosApi()
193175
```
194176

195-
### Recommendation
177+
## Recommendation
196178

197179
It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
198180
For direct call with `ApiClient`: Do not call API from the main thread, otherwise you will get a `android.os.NetworkOnMainThreadException`. Dispatch API calls with Thread, Executors or Kotlin coroutine to avoid this. Alternatively, APIs come with an asynchronous counterpart (`createAsync` for `create`) except for the upload endpoint.
199181

200-
### Have you gotten use from this API client?
182+
## Have you gotten use from this API client?
201183

202184
Please take a moment to leave a star on the client ⭐
203185

204186
This helps other users to find the clients and also helps us understand which clients are most popular. Thank you!
205187

206-
## Contribution
188+
# Contribution
207189

208190
Since this API client is generated from an OpenAPI description, we cannot accept pull requests made directly to the repository. If you want to contribute, you can open a pull request on the repository of our [client generator](https://github.com/apivideo/api-client-generator). Otherwise, you can also simply open an issue detailing your need on this repository.

0 commit comments

Comments
 (0)