You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[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.
7
6
8
-
##Table of contents
7
+
# Table of contents
9
8
10
-
-[Table of contents](#table-of-contents)
11
9
-[Project description](#project-description)
12
10
-[Getting started](#getting-started)
13
11
-[Requirements](#requirements)
@@ -16,50 +14,34 @@
16
14
-[Gradle users](#gradle-users)
17
15
-[Others](#others)
18
16
-[Code sample](#code-sample)
19
-
-[Example](#example)
20
-
-[Upload methods](#upload-methods)
17
+
-[Upload options](#upload-options)
21
18
-[Permissions](#permissions)
22
19
-[Documentation](#documentation)
23
20
-[API Endpoints](#api-endpoints)
24
21
-[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)
-[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-)
33
28
-[Contribution](#contribution)
34
29
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
49
31
50
32
api.video's Android streamlines the coding process. Chunking files is handled for you, as is pagination and refreshing your tokens.
51
33
52
-
##Getting started
34
+
# Getting started
53
35
54
-
###Requirements
36
+
## Requirements
55
37
56
38
Building the API client library requires:
57
39
1. Java 1.8+
58
40
2. Maven/Gradle
59
41
60
-
###Installation
42
+
## Installation
61
43
62
-
####Maven users
44
+
### Maven users
63
45
64
46
Add this dependency to your project's POM:
65
47
@@ -72,15 +54,15 @@ Add this dependency to your project's POM:
@@ -93,7 +75,7 @@ Then manually install the following JARs:
93
75
*`target/android-video-uploader-1.3.2.jar`
94
76
*`target/lib/*.jar`
95
77
96
-
###Code sample
78
+
## Code sample
97
79
98
80
Please follow the [installation](#installation) instruction and execute the following Kotlin code:
99
81
@@ -109,18 +91,18 @@ val workManager = WorkManager.getInstance(context) // WorkManager comes from pac
109
91
workManager.uploadWithUploadToken("MY_UPLOAD_TOKEN", myVideoFile) // Dispatch the upload with the WorkManager
110
92
```
111
93
112
-
####Example
94
+
### Example
113
95
114
96
Examples that demonstrate how to use the API is provided in folder `examples/`.
115
97
116
-
###Upload methods
98
+
## Upload methods
117
99
118
100
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.
121
103
* 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.
122
104
123
-
###Permissions
105
+
## Permissions
124
106
125
107
You have to add the following permissions in your `AndroidManifest.xml`:
126
108
@@ -132,51 +114,51 @@ You have to add the following permissions in your `AndroidManifest.xml`:
132
114
133
115
Your application also has to dynamically request the `android.permission.READ_EXTERNAL_STORAGE` permission to upload videos.
134
116
135
-
##Documentation
117
+
# Documentation
136
118
137
-
###API Endpoints
119
+
## API Endpoints
138
120
139
121
All URIs are relative to *https://ws.api.video*
140
122
141
123
142
-
####VideosApi
124
+
### VideosApi
143
125
144
126
145
-
#####Retrieve an instance of VideosApi:
127
+
#### Retrieve an instance of VideosApi:
146
128
```kotlin
147
129
val videosApi =VideosApi("YOUR_API_KEY", Environment.PRODUCTION)
148
130
```
149
131
150
132
151
133
152
-
#####Endpoints
134
+
#### Endpoints
153
135
154
136
Method | HTTP request | Description
155
137
------------- | ------------- | -------------
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
Most endpoints required to be authenticated using the API key mechanism described in our [documentation](https://docs.api.video/reference#authentication).
182
164
@@ -185,24 +167,24 @@ Only the [Public endpoints](#public-endpoints) can be called without authenticat
185
167
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.
186
168
187
169
188
-
####Public endpoints
170
+
### Public endpoints
189
171
190
172
Some endpoints don't require authentication. These one can be called with a client instantiated without API key:
191
173
```kotlin
192
174
val videosApi =VideosApi()
193
175
```
194
176
195
-
###Recommendation
177
+
## Recommendation
196
178
197
179
It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
198
180
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.
199
181
200
-
###Have you gotten use from this API client?
182
+
## Have you gotten use from this API client?
201
183
202
184
Please take a moment to leave a star on the client ⭐
203
185
204
186
This helps other users to find the clients and also helps us understand which clients are most popular. Thank you!
205
187
206
-
##Contribution
188
+
# Contribution
207
189
208
190
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