Skip to content

Commit c38bb99

Browse files
Merge pull request #227 from apivideo/add-transcript-feature
Add transcript feature
2 parents c6021bf + bf70b5a commit c38bb99

21 files changed

+276
-2
lines changed

CHANGELOG.md

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

4+
## [2.6.4] - 2024-10-08
5+
- Add transcript feature
6+
47
## [2.6.3] - 2024-09-30
58
- Add /tags API endpoint
69

docs/model/Video.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Name | Type | Description | Notes
1414
**discardedAt** | **Date** | The date and time the video was discarded. The API populates this field only if you have the Video Restore feature enabled and discard a video. Date and time are provided using ATOM UTC format. | [optional]
1515
**deletesAt** | **Date** | The date and time the video will be permanently deleted. The API populates this field only if you have the Video Restore feature enabled and discard a video. Discarded videos are pemanently deleted after 90 days. Date and time are provided using ATOM UTC format. | [optional]
1616
**discarded** | **boolean** | Returns `true` for videos you discarded when you have the Video Restore feature enabled. Returns `false` for every other video. | [optional]
17+
**language** | **string** | Returns the language of a video in [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. You can set the language during video creation via the API, otherwise it is detected automatically. | [optional]
18+
**languageOrigin** | [**VideoLanguageOriginEnum**](#VideoLanguageOriginEnum) | Returns the origin of the last update on the video's `language` attribute. - `api` means that the last update was requested from the API. - `auto` means that the last update was done automatically by the API. | [optional]
1719
**tags** | **Array<string>** | One array of tags (each tag is a string) in order to categorize a video. Tags may include spaces. | [optional]
1820
**metadata** | [**Array<Metadata>**](Metadata.md) | Metadata you can use to categorise and filter videos. Metadata is a list of dictionaries, where each dictionary represents a key value pair for categorising a video. | [optional]
1921
**source** | [**VideoSource**](VideoSource.md) | | [optional]
@@ -25,3 +27,12 @@ Name | Type | Description | Notes
2527

2628

2729

30+
## Enum: VideoLanguageOriginEnum
31+
32+
Name | Value
33+
---- | -----
34+
Api | 'api'
35+
Auto | 'auto'
36+
37+
38+

docs/model/VideoCreationPayload.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,48 @@ Name | Type | Description | Notes
1616
**metadata** | [**Array<Metadata>**](Metadata.md) | A list of key value pairs that you use to provide metadata for your video. | [optional]
1717
**clip** | [**VideoClip**](VideoClip.md) | | [optional]
1818
**watermark** | [**VideoWatermark**](VideoWatermark.md) | | [optional]
19+
**language** | [**VideoCreationPayloadLanguageEnum**](#VideoCreationPayloadLanguageEnum) | Use this parameter to set the language of the video. When this parameter is set, the API creates a transcript of the video using the language you specify. You must use the [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. `language` is a permanent attribute of the video. You can update it to another language using the [`PATCH /videos/{videoId}`](https://docs.api.video/reference/api/Videos#update-a-video-object) operation. This triggers the API to generate a new transcript using a different language. | [optional]
20+
**transcript** | **boolean** | Use this parameter to enable transcription. - When `true`, the API generates a transcript for the video. - The default value is `false`. - If you define a video language using the `language` parameter, the API uses that language to transcribe the video. If you do not define a language, the API detects it based on the video. - When the API generates a transcript, it will be available as a caption for the video. | [optional]
21+
22+
23+
24+
## Enum: VideoCreationPayloadLanguageEnum
25+
26+
Name | Value
27+
---- | -----
28+
Ar | 'ar'
29+
Ca | 'ca'
30+
Cs | 'cs'
31+
Da | 'da'
32+
De | 'de'
33+
El | 'el'
34+
En | 'en'
35+
Es | 'es'
36+
Fa | 'fa'
37+
Fi | 'fi'
38+
Fr | 'fr'
39+
He | 'he'
40+
Hi | 'hi'
41+
Hr | 'hr'
42+
Hu | 'hu'
43+
It | 'it'
44+
Ja | 'ja'
45+
Ko | 'ko'
46+
Ml | 'ml'
47+
Nl | 'nl'
48+
Nn | 'nn'
49+
False | 'false'
50+
Pl | 'pl'
51+
Pt | 'pt'
52+
Ru | 'ru'
53+
Sk | 'sk'
54+
Sl | 'sl'
55+
Te | 'te'
56+
Tr | 'tr'
57+
Uk | 'uk'
58+
Ur | 'ur'
59+
Vi | 'vi'
60+
Zh | 'zh'
1961

2062

2163

docs/model/VideoUpdatePayload.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,48 @@ Name | Type | Description | Notes
1313
**mp4Support** | **boolean** | Whether the player supports the mp4 format. | [optional]
1414
**tags** | **Array<string>** | A list of terms or words you want to tag the video with. Make sure the list includes all the tags you want as whatever you send in this list will overwrite the existing list for the video. | [optional]
1515
**metadata** | [**Array<Metadata>**](Metadata.md) | A list (array) of dictionaries where each dictionary contains a key value pair that describes the video. As with tags, you must send the complete list of metadata you want as whatever you send here will overwrite the existing metadata for the video. | [optional]
16+
**language** | [**VideoUpdatePayloadLanguageEnum**](#VideoUpdatePayloadLanguageEnum) | Use this parameter to set the language of the video. When this parameter is set, the API creates a transcript of the video using the language you specify. You must use the [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. `language` is a permanent attribute of the video. You can update it to another language using the [`PATCH /videos/{videoId}`](https://docs.api.video/reference/api/Videos#update-a-video-object) operation. This triggers the API to generate a new transcript using a different language. | [optional]
17+
**transcript** | **boolean** | Use this parameter to enable transcription. - When `true`, the API generates a transcript for the video. - The default value is `false`. - If you define a video language using the `language` parameter, the API uses that language to transcribe the video. If you do not define a language, the API detects it based on the video. - When the API generates a transcript, it will be available as a caption for the video. | [optional]
18+
19+
20+
21+
## Enum: VideoUpdatePayloadLanguageEnum
22+
23+
Name | Value
24+
---- | -----
25+
Ar | 'ar'
26+
Ca | 'ca'
27+
Cs | 'cs'
28+
Da | 'da'
29+
De | 'de'
30+
El | 'el'
31+
En | 'en'
32+
Es | 'es'
33+
Fa | 'fa'
34+
Fi | 'fi'
35+
Fr | 'fr'
36+
He | 'he'
37+
Hi | 'hi'
38+
Hr | 'hr'
39+
Hu | 'hu'
40+
It | 'it'
41+
Ja | 'ja'
42+
Ko | 'ko'
43+
Ml | 'ml'
44+
Nl | 'nl'
45+
Nn | 'nn'
46+
False | 'false'
47+
Pl | 'pl'
48+
Pt | 'pt'
49+
Ru | 'ru'
50+
Sk | 'sk'
51+
Sl | 'sl'
52+
Te | 'te'
53+
Tr | 'tr'
54+
Uk | 'uk'
55+
Ur | 'ur'
56+
Vi | 'vi'
57+
Zh | 'zh'
1658

1759

1860

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@api.video/nodejs-client",
3-
"version": "2.6.3",
3+
"version": "2.6.4",
44
"description": "api.video nodejs API client",
55
"keywords": [
66
"api.video",

src/HttpClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default class HttpClient {
5959
this.chunkSize = params.chunkSize;
6060
this.headers = new AxiosHeaders({
6161
Accept: 'application/json, */*;q=0.8',
62-
'AV-Origin-Client': 'nodejs:2.6.3',
62+
'AV-Origin-Client': 'nodejs:2.6.4',
6363
Authorization: this.apiKey ? `Basic ${encode(`${this.apiKey}:`)}` : '',
6464
...(params.applicationName && params.applicationVersion
6565
? {

src/ObjectSerializer.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,10 @@ const enumsMap: Set<string> = new Set<string>([
119119
'QualityTypeEnum',
120120
'QualityQualityEnum',
121121
'QualityStatusEnum',
122+
'VideoLanguageOriginEnum',
123+
'VideoCreationPayloadLanguageEnum',
122124
'VideoStatusIngestStatusEnum',
125+
'VideoUpdatePayloadLanguageEnum',
123126
]);
124127

125128
const typeMap: { [index: string]: any } = {

src/model/Video.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ export default class Video {
5151
* Returns `true` for videos you discarded when you have the Video Restore feature enabled. Returns `false` for every other video.
5252
*/
5353
'discarded'?: boolean;
54+
/**
55+
* Returns the language of a video in [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. You can set the language during video creation via the API, otherwise it is detected automatically.
56+
*/
57+
'language'?: string;
58+
/**
59+
* Returns the origin of the last update on the video's `language` attribute. - `api` means that the last update was requested from the API. - `auto` means that the last update was done automatically by the API.
60+
*/
61+
'languageOrigin'?: VideoLanguageOriginEnum;
5462
/**
5563
* One array of tags (each tag is a string) in order to categorize a video. Tags may include spaces.
5664
*/
@@ -135,6 +143,18 @@ export default class Video {
135143
type: 'boolean',
136144
format: '',
137145
},
146+
{
147+
name: 'language',
148+
baseName: 'language',
149+
type: 'string',
150+
format: '',
151+
},
152+
{
153+
name: 'languageOrigin',
154+
baseName: 'languageOrigin',
155+
type: 'VideoLanguageOriginEnum',
156+
format: '',
157+
},
138158
{
139159
name: 'tags',
140160
baseName: 'tags',
@@ -189,3 +209,5 @@ export default class Video {
189209
return Video.attributeTypeMap;
190210
}
191211
}
212+
213+
export type VideoLanguageOriginEnum = 'api' | 'auto';

src/model/VideoCreationPayload.ts

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ export default class VideoCreationPayload {
5353
'metadata'?: Array<Metadata>;
5454
'clip'?: VideoClip;
5555
'watermark'?: VideoWatermark;
56+
/**
57+
* Use this parameter to set the language of the video. When this parameter is set, the API creates a transcript of the video using the language you specify. You must use the [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. `language` is a permanent attribute of the video. You can update it to another language using the [`PATCH /videos/{videoId}`](https://docs.api.video/reference/api/Videos#update-a-video-object) operation. This triggers the API to generate a new transcript using a different language.
58+
*/
59+
'language'?: VideoCreationPayloadLanguageEnum;
60+
/**
61+
* Use this parameter to enable transcription. - When `true`, the API generates a transcript for the video. - The default value is `false`. - If you define a video language using the `language` parameter, the API uses that language to transcribe the video. If you do not define a language, the API detects it based on the video. - When the API generates a transcript, it will be available as a caption for the video.
62+
*/
63+
'transcript'?: boolean;
5664

5765
static readonly discriminator?: string = undefined;
5866

@@ -123,9 +131,56 @@ export default class VideoCreationPayload {
123131
type: 'VideoWatermark',
124132
format: '',
125133
},
134+
{
135+
name: 'language',
136+
baseName: 'language',
137+
type: 'VideoCreationPayloadLanguageEnum',
138+
format: '',
139+
},
140+
{
141+
name: 'transcript',
142+
baseName: 'transcript',
143+
type: 'boolean',
144+
format: '',
145+
},
126146
];
127147

128148
static getAttributeTypeMap(): Array<AttributeType> {
129149
return VideoCreationPayload.attributeTypeMap;
130150
}
131151
}
152+
153+
export type VideoCreationPayloadLanguageEnum =
154+
| 'ar'
155+
| 'ca'
156+
| 'cs'
157+
| 'da'
158+
| 'de'
159+
| 'el'
160+
| 'en'
161+
| 'es'
162+
| 'fa'
163+
| 'fi'
164+
| 'fr'
165+
| 'he'
166+
| 'hi'
167+
| 'hr'
168+
| 'hu'
169+
| 'it'
170+
| 'ja'
171+
| 'ko'
172+
| 'ml'
173+
| 'nl'
174+
| 'nn'
175+
| 'false'
176+
| 'pl'
177+
| 'pt'
178+
| 'ru'
179+
| 'sk'
180+
| 'sl'
181+
| 'te'
182+
| 'tr'
183+
| 'uk'
184+
| 'ur'
185+
| 'vi'
186+
| 'zh';

src/model/VideoUpdatePayload.ts

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ export default class VideoUpdatePayload {
4545
* A list (array) of dictionaries where each dictionary contains a key value pair that describes the video. As with tags, you must send the complete list of metadata you want as whatever you send here will overwrite the existing metadata for the video.
4646
*/
4747
'metadata'?: Array<Metadata>;
48+
/**
49+
* Use this parameter to set the language of the video. When this parameter is set, the API creates a transcript of the video using the language you specify. You must use the [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. `language` is a permanent attribute of the video. You can update it to another language using the [`PATCH /videos/{videoId}`](https://docs.api.video/reference/api/Videos#update-a-video-object) operation. This triggers the API to generate a new transcript using a different language.
50+
*/
51+
'language'?: VideoUpdatePayloadLanguageEnum;
52+
/**
53+
* Use this parameter to enable transcription. - When `true`, the API generates a transcript for the video. - The default value is `false`. - If you define a video language using the `language` parameter, the API uses that language to transcribe the video. If you do not define a language, the API detects it based on the video. - When the API generates a transcript, it will be available as a caption for the video.
54+
*/
55+
'transcript'?: boolean;
4856

4957
static readonly discriminator?: string = undefined;
5058

@@ -97,9 +105,56 @@ export default class VideoUpdatePayload {
97105
type: 'Array<Metadata>',
98106
format: '',
99107
},
108+
{
109+
name: 'language',
110+
baseName: 'language',
111+
type: 'VideoUpdatePayloadLanguageEnum',
112+
format: '',
113+
},
114+
{
115+
name: 'transcript',
116+
baseName: 'transcript',
117+
type: 'boolean',
118+
format: '',
119+
},
100120
];
101121

102122
static getAttributeTypeMap(): Array<AttributeType> {
103123
return VideoUpdatePayload.attributeTypeMap;
104124
}
105125
}
126+
127+
export type VideoUpdatePayloadLanguageEnum =
128+
| 'ar'
129+
| 'ca'
130+
| 'cs'
131+
| 'da'
132+
| 'de'
133+
| 'el'
134+
| 'en'
135+
| 'es'
136+
| 'fa'
137+
| 'fi'
138+
| 'fr'
139+
| 'he'
140+
| 'hi'
141+
| 'hr'
142+
| 'hu'
143+
| 'it'
144+
| 'ja'
145+
| 'ko'
146+
| 'ml'
147+
| 'nl'
148+
| 'nn'
149+
| 'false'
150+
| 'pl'
151+
| 'pt'
152+
| 'ru'
153+
| 'sk'
154+
| 'sl'
155+
| 'te'
156+
| 'tr'
157+
| 'uk'
158+
| 'ur'
159+
| 'vi'
160+
| 'zh';

0 commit comments

Comments
 (0)