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
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.
[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.
@@ -60,7 +75,7 @@ Then manually install the following JARs:
60
75
*`target/android-video-uploader-1.3.2.jar`
61
76
*`target/lib/*.jar`
62
77
63
-
###Code sample
78
+
## Code sample
64
79
65
80
Please follow the [installation](#installation) instruction and execute the following Kotlin code:
66
81
@@ -76,18 +91,18 @@ val workManager = WorkManager.getInstance(context) // WorkManager comes from pac
76
91
workManager.uploadWithUploadToken("MY_UPLOAD_TOKEN", myVideoFile) // Dispatch the upload with the WorkManager
77
92
```
78
93
79
-
####Example
94
+
### Example
80
95
81
96
Examples that demonstrate how to use the API is provided in folder `examples/`.
82
97
83
-
###Upload methods
98
+
## Upload methods
84
99
85
100
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.
88
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.
89
104
90
-
###Permissions
105
+
## Permissions
91
106
92
107
You have to add the following permissions in your `AndroidManifest.xml`:
93
108
@@ -99,51 +114,51 @@ You have to add the following permissions in your `AndroidManifest.xml`:
99
114
100
115
Your application also has to dynamically request the `android.permission.READ_EXTERNAL_STORAGE` permission to upload videos.
101
116
102
-
##Documentation
117
+
# Documentation
103
118
104
-
###API Endpoints
119
+
## API Endpoints
105
120
106
121
All URIs are relative to *https://ws.api.video*
107
122
108
123
109
-
####VideosApi
124
+
### VideosApi
110
125
111
126
112
-
#####Retrieve an instance of VideosApi:
127
+
#### Retrieve an instance of VideosApi:
113
128
```kotlin
114
129
val videosApi =VideosApi("YOUR_API_KEY", Environment.PRODUCTION)
115
130
```
116
131
117
132
118
133
119
-
#####Endpoints
134
+
#### Endpoints
120
135
121
136
Method | HTTP request | Description
122
137
------------- | ------------- | -------------
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
Most endpoints required to be authenticated using the API key mechanism described in our [documentation](https://docs.api.video/reference#authentication).
149
164
@@ -152,24 +167,24 @@ Only the [Public endpoints](#public-endpoints) can be called without authenticat
152
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.
153
168
154
169
155
-
####Public endpoints
170
+
### Public endpoints
156
171
157
172
Some endpoints don't require authentication. These one can be called with a client instantiated without API key:
158
173
```kotlin
159
174
val videosApi =VideosApi()
160
175
```
161
176
162
-
###Recommendation
177
+
## Recommendation
163
178
164
179
It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
165
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.
166
181
167
-
###Have you gotten use from this API client?
182
+
## Have you gotten use from this API client?
168
183
169
184
Please take a moment to leave a star on the client ⭐
170
185
171
186
This helps other users to find the clients and also helps us understand which clients are most popular. Thank you!
172
187
173
-
##Contribution
188
+
# Contribution
174
189
175
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