Skip to content

Commit 7cbd6a4

Browse files
feat(swift5): use Basic auth instead of Bearer
1 parent e347d29 commit 7cbd6a4

File tree

1 file changed

+68
-53
lines changed

1 file changed

+68
-53
lines changed
Lines changed: 68 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,47 @@
1-
---
2-
title: api.video Android video uploader
3-
meta:
4-
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.
5-
---
6-
<!--
7-
THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT!
8-
IF YOU NEED TO CHANGE THIS FILE, CREATE A PR IN THE SOURCE REPOSITORY.
9-
-->
10-
11-
# api.video Android video uploader
12-
13-
[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.
14-
15-
## Project description
1+
[![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)
2+
![](https://github.com/apivideo/.github/blob/main/assets/apivideo_banner.png)
3+
<h1 align="center">api.video Android uploader</h1>
4+
5+
[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.
6+
7+
# Table of contents
8+
9+
- [Project description](#project-description)
10+
- [Getting started](#getting-started)
11+
- [Requirements](#requirements)
12+
- [Installation](#installation)
13+
- [Maven users](#maven-users)
14+
- [Gradle users](#gradle-users)
15+
- [Others](#others)
16+
- [Code sample](#code-sample)
17+
- [Upload options](#upload-options)
18+
- [Permissions](#permissions)
19+
- [Documentation](#documentation)
20+
- [API Endpoints](#api-endpoints)
21+
- [VideosApi](#videosapi)
22+
- [Models](#models)
23+
- [Authorization](#documentation-for-authorization)
24+
- [API key](#api-key)
25+
- [Public endpoints](#public-endpoints)
26+
- [Recommendation](#recommendation)
27+
- [Have you gotten use from this API client?](#have-you-gotten-use-from-this-api-client-)
28+
- [Contribution](#contribution)
29+
30+
# Project description
1631

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

19-
## Getting started
34+
# Getting started
2035

21-
### Requirements
36+
## Requirements
2237

2338
Building the API client library requires:
2439
1. Java 1.8+
2540
2. Maven/Gradle
2641

27-
### Installation
42+
## Installation
2843

29-
#### Maven users
44+
### Maven users
3045

3146
Add this dependency to your project's POM:
3247

@@ -39,15 +54,15 @@ Add this dependency to your project's POM:
3954
</dependency>
4055
```
4156

42-
#### Gradle users
57+
### Gradle users
4358

4459
Add this dependency to your project's build file:
4560

4661
```groovy
4762
implementation "video.api:android-video-uploader:1.3.2"
4863
```
4964

50-
#### Others
65+
### Others
5166

5267
At first generate the JAR by executing:
5368

@@ -60,7 +75,7 @@ Then manually install the following JARs:
6075
* `target/android-video-uploader-1.3.2.jar`
6176
* `target/lib/*.jar`
6277

63-
### Code sample
78+
## Code sample
6479

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

@@ -76,18 +91,18 @@ val workManager = WorkManager.getInstance(context) // WorkManager comes from pac
7691
workManager.uploadWithUploadToken("MY_UPLOAD_TOKEN", myVideoFile) // Dispatch the upload with the WorkManager
7792
```
7893

79-
#### Example
94+
### Example
8095

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

83-
### Upload methods
98+
## Upload methods
8499

85100
To upload a video, you have 3 differents methods:
86-
* `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.
87-
* `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.
88103
* 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.
89104

90-
### Permissions
105+
## Permissions
91106

92107
You have to add the following permissions in your `AndroidManifest.xml`:
93108

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

100115
Your application also has to dynamically request the `android.permission.READ_EXTERNAL_STORAGE` permission to upload videos.
101116

102-
## Documentation
117+
# Documentation
103118

104-
### API Endpoints
119+
## API Endpoints
105120

106121
All URIs are relative to *https://ws.api.video*
107122

108123

109-
#### VideosApi
124+
### VideosApi
110125

111126

112-
##### Retrieve an instance of VideosApi:
127+
#### Retrieve an instance of VideosApi:
113128
```kotlin
114129
val videosApi = VideosApi("YOUR_API_KEY", Environment.PRODUCTION)
115130
```
116131

117132

118133

119-
##### Endpoints
134+
#### Endpoints
120135

121136
Method | HTTP request | Description
122137
------------- | ------------- | -------------
123-
[**upload**](https://github.com/apivideo/api.video-android-uploader/blob/main/docs/VideosApi.md#upload) | **POST** /videos/{videoId}/source | Upload a video
124-
[**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
125140

126141

127142

128-
### Documentation for Models
143+
## Documentation for Models
129144

130-
- [AccessToken](https://github.com/apivideo/api.video-android-uploader/blob/main/docs/AccessToken.md)
131-
- [AdditionalBadRequestErrors](https://github.com/apivideo/api.video-android-uploader/blob/main/docs/AdditionalBadRequestErrors.md)
132-
- [AuthenticatePayload](https://github.com/apivideo/api.video-android-uploader/blob/main/docs/AuthenticatePayload.md)
133-
- [BadRequest](https://github.com/apivideo/api.video-android-uploader/blob/main/docs/BadRequest.md)
134-
- [Metadata](https://github.com/apivideo/api.video-android-uploader/blob/main/docs/Metadata.md)
135-
- [NotFound](https://github.com/apivideo/api.video-android-uploader/blob/main/docs/NotFound.md)
136-
- [RefreshTokenPayload](https://github.com/apivideo/api.video-android-uploader/blob/main/docs/RefreshTokenPayload.md)
137-
- [Video](https://github.com/apivideo/api.video-android-uploader/blob/main/docs/Video.md)
138-
- [VideoAssets](https://github.com/apivideo/api.video-android-uploader/blob/main/docs/VideoAssets.md)
139-
- [VideoSource](https://github.com/apivideo/api.video-android-uploader/blob/main/docs/VideoSource.md)
140-
- [VideoSourceLiveStream](https://github.com/apivideo/api.video-android-uploader/blob/main/docs/VideoSourceLiveStream.md)
141-
- [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)
142157

143158

144-
### Documentation for Authorization
159+
## Documentation for Authorization
145160

146-
#### API key
161+
### API key
147162

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

@@ -152,24 +167,24 @@ Only the [Public endpoints](#public-endpoints) can be called without authenticat
152167
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.
153168

154169

155-
#### Public endpoints
170+
### Public endpoints
156171

157172
Some endpoints don't require authentication. These one can be called with a client instantiated without API key:
158173
```kotlin
159174
val videosApi = VideosApi()
160175
```
161176

162-
### Recommendation
177+
## Recommendation
163178

164179
It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
165180
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.
166181

167-
### Have you gotten use from this API client?
182+
## Have you gotten use from this API client?
168183

169184
Please take a moment to leave a star on the client ⭐
170185

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

173-
## Contribution
188+
# Contribution
174189

175190
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)