|
1 | 1 | [](https://twitter.com/intent/follow?screen_name=api_video) []() [](https://community.api.video) |
2 | 2 |  |
3 | | -<h1 align="center">api.video iOS uploader</h1> |
| 3 | +<h1 align="center">api.video Swift uploader</h1> |
4 | 4 |
|
5 | 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 | 6 |
|
|
24 | 24 |
|
25 | 25 | # Project description |
26 | 26 |
|
27 | | -api.video's iOS uploads videos to api.video using delegated upload token or API Key. |
| 27 | +api.video's Swift for iOS, macOS and tvOS uploads videos to api.video using delegated upload token or API Key. |
28 | 28 |
|
29 | 29 | It allows you to upload videos in two ways: |
30 | 30 | - standard upload: to send a whole video file in one go |
@@ -56,21 +56,17 @@ Please follow the [installation](#installation) instruction and execute the foll |
56 | 56 | ```swift |
57 | 57 | import ApiVideoUploader |
58 | 58 |
|
| 59 | +// If you rather like to use the sandbox environment: |
| 60 | +// ApiVideoUploader.basePath = Environment.sandbox.rawValue |
59 | 61 |
|
60 | | - // If you rather like to use the sandbox environment: |
61 | | - // ApiVideoUploader.basePath = Environment.sandbox.rawValue |
62 | | - // If you rather like to upload with your "YOUR_API_KEY" (upload) |
63 | | - // ApiVideoUploader.apiKey = "YOUR_API_KEY" |
64 | | - |
65 | | - try VideosAPI.uploadWithUploadToken(token: "MY_VIDEO_TOKEN", file: url) { video, error in |
66 | | - if let video = video { |
67 | | - // Manage upload with upload token success here |
68 | | - } |
69 | | - if let error = error { |
70 | | - // Manage upload with upload token error here |
71 | | - } |
| 62 | +try VideosAPI.uploadWithUploadToken(token: "MY_VIDEO_TOKEN", file: url) { video, error in |
| 63 | + if let video = video { |
| 64 | + // Manage upload with upload token success here |
72 | 65 | } |
73 | | - |
| 66 | + if let error = error { |
| 67 | + // Manage upload with upload token error here |
| 68 | + } |
| 69 | +} |
74 | 70 | ``` |
75 | 71 |
|
76 | 72 | # Documentation |
@@ -118,14 +114,14 @@ Method | HTTP request | Description |
118 | 114 | ### API key |
119 | 115 |
|
120 | 116 | Most endpoints required to be authenticated using the API key mechanism described in our [documentation](https://docs.api.video/reference#authentication). |
121 | | -The access token generation mechanism is automatically handled by the client. All you have to do is provide an API key: |
122 | | -```swift |
123 | | -ApiVideoUploader.apiKey = YOUR_API_KEY |
124 | | -``` |
| 117 | + |
| 118 | +You must NOT store your API key in your application code to prevent your API key from being exposed in your source code. |
| 119 | +Only the [Public endpoints](#public-endpoints) can be called without authentication. |
| 120 | +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. |
125 | 121 |
|
126 | 122 | ### Public endpoints |
127 | 123 |
|
128 | | -Some endpoints don't require authentication. These one can be called without setting `ApiVideoUploader.apiKey`: |
| 124 | +Some endpoints don't require authentication. These one can be called without setting `ApiVideoUploader.apiKey`. |
129 | 125 |
|
130 | 126 | ## Have you gotten use from this API client? |
131 | 127 |
|
|
0 commit comments