Skip to content

Commit 3652c62

Browse files
Merge pull request #63 from apivideo/watermark-and-clip
feat(all): add watermarks & video clips
2 parents 5a0183f + f1af403 commit 3652c62

27 files changed

+790
-4
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Changelog
22
All changes to this project will be documented in this file.
33

4+
## [2.2.0] - 2022-01-07
5+
- Add watermark endpoints
6+
- Add video clips
7+
- Fix tags[] query parameter format of GET /videos
8+
- Correctly distinguish between "undefined", "defined" and "null" values if the playerId parameter of PATCH /videos/{videoId}
9+
410
## [2.1.1] - 2021-12-08
511
- Bump project dependancies
612

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
- [RawStatisticsApi](#rawstatisticsapi)
2222
- [UploadTokensApi](#uploadtokensapi)
2323
- [VideosApi](#videosapi)
24+
- [WatermarksApi](#watermarksapi)
2425
- [WebhooksApi](#webhooksapi)
2526
- [Models](#models)
2627
- [Authorization](#authorization)
@@ -235,6 +236,24 @@ Method | HTTP request | Description
235236
[**uploadThumbnail**](doc/api/VideosApi.md#uploadThumbnail) | **POST** /videos/{videoId}/thumbnail | Upload a thumbnail
236237

237238

239+
### WatermarksApi
240+
241+
```js
242+
const ApiVideoClient = require('@api.video/nodejs-client');
243+
244+
const apiVideoClient = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
245+
const watermarks = apiVideoClient.watermarks;
246+
```
247+
248+
#### Endpoints
249+
250+
Method | HTTP request | Description
251+
------------- | ------------- | -------------
252+
[**delete**](doc/api/WatermarksApi.md#delete) | **DELETE** /watermarks/{watermarkId} | Delete a watermark
253+
[**list**](doc/api/WatermarksApi.md#list) | **GET** /watermarks | List all watermarks
254+
[**upload**](doc/api/WatermarksApi.md#upload) | **POST** /watermarks | Upload a watermark
255+
256+
238257
### WebhooksApi
239258

240259
```js
@@ -298,6 +317,7 @@ Method | HTTP request | Description
298317
- [UploadToken](doc/model/UploadToken.md)
299318
- [Video](doc/model/Video.md)
300319
- [VideoAssets](doc/model/VideoAssets.md)
320+
- [VideoClip](doc/model/VideoClip.md)
301321
- [VideoCreationPayload](doc/model/VideoCreationPayload.md)
302322
- [VideoSession](doc/model/VideoSession.md)
303323
- [VideoSessionClient](doc/model/VideoSessionClient.md)
@@ -315,7 +335,10 @@ Method | HTTP request | Description
315335
- [VideoStatusIngest](doc/model/VideoStatusIngest.md)
316336
- [VideoThumbnailPickPayload](doc/model/VideoThumbnailPickPayload.md)
317337
- [VideoUpdatePayload](doc/model/VideoUpdatePayload.md)
338+
- [VideoWatermark](doc/model/VideoWatermark.md)
318339
- [VideosListResponse](doc/model/VideosListResponse.md)
340+
- [Watermark](doc/model/Watermark.md)
341+
- [WatermarksListResponse](doc/model/WatermarksListResponse.md)
319342
- [Webhook](doc/model/Webhook.md)
320343
- [WebhooksCreationPayload](doc/model/WebhooksCreationPayload.md)
321344
- [WebhooksListResponse](doc/model/WebhooksListResponse.md)

doc/api/VideosApi.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,8 @@ try {
393393
playerId: "pl45KFKdlddgk654dspkze", // The unique identification number for your video player.
394394
tags: ["maths", "string theory", "video"], // A list of tags you want to use to describe your video.
395395
metadata: [{"key": "Author", "value": "John Doe"}], // A list of key value pairs that you use to provide metadata for your video. These pairs can be made dynamic, allowing you to segment your audience. Read more on [dynamic metadata](https://api.video/blog/endpoints/dynamic-metadata).
396+
clip: null,
397+
watermark: null,
396398
};
397399

398400
// Video

doc/api/WatermarksApi.md

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# WatermarksApi
2+
3+
All URIs are relative to *https://ws.api.video*
4+
5+
Method | HTTP request | Description
6+
------------- | ------------- | -------------
7+
[**delete**](WatermarksApi.md#delete) | **DELETE** /watermarks/{watermarkId} | Delete a watermark
8+
[**list**](WatermarksApi.md#list) | **GET** /watermarks | List all watermarks
9+
[**upload**](WatermarksApi.md#upload) | **POST** /watermarks | Upload a watermark
10+
11+
12+
<a name="delete"></a>
13+
## **delete**
14+
15+
16+
### Example
17+
```js
18+
(async () => {
19+
try {
20+
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
21+
22+
const watermarkId = 'watermark_1BWr2L5MTQwxGkuxKjzh6i'; // The watermark ID for the watermark you want to delete.
23+
24+
// void
25+
const result = await client.watermarks.delete(watermarkId);
26+
console.log(result);
27+
} catch (e) {
28+
console.error(e);
29+
}
30+
})();
31+
```
32+
33+
### Parameters
34+
35+
Name | Type | Description | Notes
36+
------------- | ------------- | ------------- | -------------
37+
**watermarkId** | **string**| The watermark ID for the watermark you want to delete. | [default to undefined]
38+
39+
### Return type
40+
[**void**](../model/.md)
41+
42+
### HTTP request headers
43+
44+
- **Content-Type**: Not defined
45+
- **Accept**: application/json
46+
47+
### HTTP response details
48+
| Status code | Description | Response headers |
49+
|-------------|-------------|------------------|
50+
**204** | No Content | - |
51+
**404** | Not Found | - |
52+
53+
<a name="list"></a>
54+
## **list**
55+
56+
57+
### Example
58+
```js
59+
(async () => {
60+
try {
61+
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
62+
63+
const sortBy = 'createdAt'; // Allowed: createdAt. You can search by the time watermark were created at.
64+
const sortOrder = 'asc'; // Allowed: asc, desc. asc is ascending and sorts from A to Z. desc is descending and sorts from Z to A.
65+
const currentPage = '2'; // Choose the number of search results to return per page. Minimum value: 1
66+
const pageSize = '30'; // Results per page. Allowed values 1-100, default is 25.
67+
68+
// WatermarksListResponse
69+
const result = await client.watermarks.list({ sortBy, sortOrder, currentPage, pageSize })
70+
console.log(result);
71+
} catch (e) {
72+
console.error(e);
73+
}
74+
})();
75+
```
76+
77+
### Parameters
78+
79+
Name | Type | Description | Notes
80+
------------- | ------------- | ------------- | -------------
81+
**sortBy** | **string**| Allowed: createdAt. You can search by the time watermark were created at. | [optional] [default to undefined]
82+
**sortOrder** | **string**| Allowed: asc, desc. asc is ascending and sorts from A to Z. desc is descending and sorts from Z to A. | [optional] [default to undefined]
83+
**currentPage** | **number**| Choose the number of search results to return per page. Minimum value: 1 | [optional] [default to 1]
84+
**pageSize** | **number**| Results per page. Allowed values 1-100, default is 25. | [optional] [default to 25]
85+
86+
### Return type
87+
[**WatermarksListResponse**](../model/WatermarksListResponse.md)
88+
89+
### HTTP request headers
90+
91+
- **Content-Type**: Not defined
92+
- **Accept**: application/json
93+
94+
### HTTP response details
95+
| Status code | Description | Response headers |
96+
|-------------|-------------|------------------|
97+
**200** | Success | - |
98+
**400** | Bad Request | - |
99+
100+
<a name="upload"></a>
101+
## **upload**
102+
103+
104+
### Example
105+
```js
106+
(async () => {
107+
try {
108+
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
109+
110+
const file = 'BINARY_DATA_HERE'; // The .jpg or .png image to be added as a watermark.
111+
112+
// Watermark
113+
const result = await client.watermarks.upload(file);
114+
console.log(result);
115+
} catch (e) {
116+
console.error(e);
117+
}
118+
})();
119+
```
120+
121+
### Parameters
122+
123+
Name | Type | Description | Notes
124+
------------- | ------------- | ------------- | -------------
125+
**file** | **string**| The .jpg or .png image to be added as a watermark. | [default to undefined]
126+
127+
### Return type
128+
[**Watermark**](../model/Watermark.md)
129+
130+
### HTTP request headers
131+
132+
- **Content-Type**: multipart/form-data
133+
- **Accept**: application/json
134+
135+
### HTTP response details
136+
| Status code | Description | Response headers |
137+
|-------------|-------------|------------------|
138+
**200** | Success | - |
139+
**400** | Bad Request | - |
140+

doc/model/VideoClip.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
# VideoClip
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**startTimecode** | **string** | | [optional]
9+
**endTimecode** | **string** | | [optional]
10+
11+
12+

doc/model/VideoCreationPayload.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Name | Type | Description | Notes
1414
**playerId** | **string** | The unique identification number for your video player. | [optional]
1515
**tags** | **Array&lt;string&gt;** | A list of tags you want to use to describe your video. | [optional]
1616
**metadata** | [**Array&lt;Metadata&gt;**](Metadata.md) | A list of key value pairs that you use to provide metadata for your video. These pairs can be made dynamic, allowing you to segment your audience. Read more on [dynamic metadata](https://api.video/blog/endpoints/dynamic-metadata). | [optional]
17+
**clip** | [**VideoClip**](VideoClip.md) | | [optional]
18+
**watermark** | [**VideoWatermark**](VideoWatermark.md) | | [optional]
1719

1820

1921

doc/model/VideoWatermark.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
# VideoWatermark
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**id** | **string** | id of the watermark | [optional]
9+
**top** | **string** | Distance expressed in px or % between the top-border of the video and the watermark-image. | [optional]
10+
**left** | **string** | Distance expressed in px or % between the left-border of the video and the watermark-image. | [optional]
11+
**bottom** | **string** | Distance expressed in px or % between the bottom-border of the video and the watermark-image. | [optional]
12+
**right** | **string** | Distance expressed in px or % between the right-border of the video and the watermark-image. | [optional]
13+
**width** | **string** | Width of the watermark-image relative to the video if expressed in %. Otherwise a fixed width. NOTE: To keep intrinsic watermark-image width use initial | [optional]
14+
**height** | **string** | Width of the watermark-image relative to the video if expressed in %. Otherwise a fixed height. NOTE: To keep intrinsic watermark-image height use initial | [optional]
15+
**opacity** | **string** | Opacity expressed in % only to specify the degree of the watermark-image transparency with the video. | [optional]
16+
17+
18+

doc/model/Watermark.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
# Watermark
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**watermarkId** | **string** | The unique identifier of the watermark. | [optional]
9+
**createdAt** | **Date** | When the watermark was created, presented in ISO-8601 format. | [optional]
10+
11+
12+

doc/model/WatermarksListResponse.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
# WatermarksListResponse
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**data** | [**Array&lt;Watermark&gt;**](Watermark.md) | |
9+
**pagination** | [**Pagination**](Pagination.md) | |
10+
11+
12+

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)