Skip to content

Commit ed0e2cc

Browse files
author
olivierapivideo
authored
Add transcript feature
1 parent 92c63ed commit ed0e2cc

File tree

25 files changed

+811
-19
lines changed

25 files changed

+811
-19
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+
## [1.4.4] - 2024-10-08
5+
- Add transcript feature
6+
47
## [1.4.3] - 2024-09-30
58
- Add /tags API endpoint
69

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Add this dependency to your project's POM:
6969
<dependency>
7070
<groupId>video.api</groupId>
7171
<artifactId>java-api-client</artifactId>
72-
<version>1.4.3</version>
72+
<version>1.4.4</version>
7373
<scope>compile</scope>
7474
</dependency>
7575
```
@@ -79,7 +79,7 @@ Add this dependency to your project's POM:
7979
Add this dependency to your project's build file:
8080

8181
```groovy
82-
implementation "video.api:java-api-client:1.4.3"
82+
implementation "video.api:java-api-client:1.4.4"
8383
```
8484

8585
#### Others
@@ -92,7 +92,7 @@ mvn clean package
9292

9393
Then manually install the following JARs:
9494

95-
* `target/java-api-client-1.4.3.jar`
95+
* `target/java-api-client-1.4.4.jar`
9696
* `target/lib/*.jar`
9797

9898
### Code sample

api/openapi.yaml

Lines changed: 177 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,8 @@ paths:
288288
playerId: pl45KFKdlddgk654dspkze
289289
title: Maths video
290290
description: An amazing video explaining the string theory
291+
language: en
292+
languageOrigin: api
291293
public: false
292294
panoramic: false
293295
mp4Support: true
@@ -318,6 +320,8 @@ paths:
318320
- videoId: vi4blUQJFrYWbaG44NChkH27
319321
title: Video Title
320322
description: A description for your video.
323+
language: en
324+
languageOrigin: api
321325
public: false
322326
panoramic: false
323327
mp4Support: true
@@ -350,6 +354,8 @@ paths:
350354
playerId: pl45KFKdlddgk654dspkze
351355
title: My Video Title
352356
description: A brief description of the video.
357+
language: fr
358+
languageOrigin: api
353359
public: false
354360
panoramic: false
355361
mp4Support: true
@@ -616,6 +622,8 @@ paths:
616622
videoId: vi4blUQJFrYWbaG44NChkH27
617623
title: Maths video
618624
description: An amazing video explaining the string theory
625+
language: en
626+
languageOrigin: api
619627
public: false
620628
panoramic: false
621629
mp4Support: true
@@ -698,7 +706,7 @@ paths:
698706
content:
699707
application/json:
700708
examples:
701-
response:
709+
Arttribute required:
702710
value:
703711
type: https://docs.api.video/reference/attribute-required
704712
title: This attribute is required.
@@ -717,6 +725,25 @@ paths:
717725
- type: https://docs.api.video/reference/invalid-attribute
718726
title: This attribute must be an array.
719727
name: metadata
728+
Invalid language formatting:
729+
description: This error occurs when the language tag you provided
730+
contains characters other than letters and dashes.
731+
value:
732+
type: https://docs.api.video/reference/invalid-attribute
733+
title: An attribute is invalid.
734+
status: 400
735+
detail: The "language" attribute must contain only letters and
736+
dashes (for example "fr", "fr-BE").
737+
name: language
738+
Invalid language:
739+
description: This error occurs when the language tag you provided
740+
does not match any supported language.
741+
value:
742+
type: https://docs.api.video/reference/invalid-attribute
743+
title: An attribute is invalid.
744+
status: 400
745+
detail: The "language" attribute is not valid.
746+
name: language
720747
schema:
721748
$ref: '#/components/schemas/bad-request'
722749
description: Bad Request
@@ -2977,6 +3004,8 @@ paths:
29773004
playerId: pl45KFKdlddgk654dspkze
29783005
title: Maths video
29793006
description: An amazing video explaining string theory
3007+
language: en
3008+
languageOrigin: api
29803009
public: false
29813010
panoramic: false
29823011
mp4Support: true
@@ -3231,6 +3260,8 @@ paths:
32313260
playerId: pl45KFKdlddgk654dspkze
32323261
title: Maths video
32333262
description: An amazing video explaining the string theory
3263+
language: en
3264+
languageOrigin: api
32343265
public: false
32353266
panoramic: false
32363267
mp4Support: true
@@ -3286,7 +3317,7 @@ paths:
32863317
content:
32873318
application/json:
32883319
examples:
3289-
response:
3320+
Invalid attribute:
32903321
value:
32913322
type: https://docs.api.video/reference/invalid-attribute
32923323
title: This attribute must be a ISO-8601 date.
@@ -3302,6 +3333,25 @@ paths:
33023333
- type: https://docs.api.video/reference/invalid-attribute
33033334
title: This attribute must be an array.
33043335
name: metadata
3336+
Invalid language formatting:
3337+
description: This error occurs when the language tag you provided
3338+
contains characters other than letters and dashes.
3339+
value:
3340+
type: https://docs.api.video/reference/invalid-attribute
3341+
title: An attribute is invalid.
3342+
status: 400
3343+
detail: The "language" attribute must contain only letters and
3344+
dashes (for example "fr", "fr-BE").
3345+
name: language
3346+
Invalid language:
3347+
description: This error occurs when the language tag you provided
3348+
does not match any supported language.
3349+
value:
3350+
type: https://docs.api.video/reference/invalid-attribute
3351+
title: An attribute is invalid.
3352+
status: 400
3353+
detail: The "language" attribute is not valid.
3354+
name: language
33053355
schema:
33063356
$ref: '#/components/schemas/bad-request'
33073357
description: Bad Request
@@ -5607,6 +5657,7 @@ paths:
56075657
playerId: pl45KFKdlddgk654dspkze
56085658
title: Maths video
56095659
description: An amazing video explaining the string theory
5660+
language: en
56105661
public: false
56115662
panoramic: false
56125663
tags:
@@ -14886,6 +14937,8 @@ components:
1488614937
videoId: vi4k0jvEUuaTdRAEjQ4Jfrgz
1488714938
title: Maths video
1488814939
description: An amazing video explaining the string theory
14940+
language: en
14941+
languageOrigin: api
1488914942
tags:
1489014943
- maths
1489114944
- string theory
@@ -14957,6 +15010,22 @@ components:
1495715010
description: Returns `true` for videos you discarded when you have the Video
1495815011
Restore feature enabled. Returns `false` for every other video.
1495915012
type: boolean
15013+
language:
15014+
description: Returns the language of a video in [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag)
15015+
format. You can set the language during video creation via the API, otherwise
15016+
it is detected automatically.
15017+
type: string
15018+
languageOrigin:
15019+
description: |-
15020+
Returns the origin of the last update on the video's `language` attribute.
15021+
15022+
- `api` means that the last update was requested from the API.
15023+
- `auto` means that the last update was done automatically by the API.
15024+
enum:
15025+
- api
15026+
- auto
15027+
nullable: true
15028+
type: string
1496015029
tags:
1496115030
description: "One array of tags (each tag is a string) in order to categorize\
1496215031
\ a video. Tags may include spaces. \n"
@@ -15705,6 +15774,8 @@ components:
1570515774
- videoId: vi4k0jvEUuaTdRAEjQ4Jfrgz
1570615775
title: Maths video
1570715776
description: An amazing video explaining the string theory
15777+
language: en
15778+
languageOrigin: api
1570815779
tags:
1570915780
- maths
1571015781
- string theory
@@ -15726,6 +15797,8 @@ components:
1572615797
- videoId: vi4k0jvEUuaTdRAEjQ4Jfrgz
1572715798
title: Maths video
1572815799
description: An amazing video explaining the string theory
15800+
language: en
15801+
languageOrigin: api
1572915802
tags:
1573015803
- maths
1573115804
- string theory
@@ -15777,6 +15850,8 @@ components:
1577715850
panoramic: false
1577815851
mp4Support: true
1577915852
playerId: pl45KFKdlddgk654dspkze
15853+
language: en
15854+
transcript: true
1578015855
tags:
1578115856
- maths
1578215857
- string theory
@@ -15847,6 +15922,55 @@ components:
1584715922
$ref: '#/components/schemas/video-clip'
1584815923
watermark:
1584915924
$ref: '#/components/schemas/video-watermark'
15925+
language:
15926+
description: |-
15927+
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.
15928+
15929+
`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.
15930+
enum:
15931+
- ar
15932+
- ca
15933+
- cs
15934+
- da
15935+
- de
15936+
- el
15937+
- en
15938+
- es
15939+
- fa
15940+
- fi
15941+
- fr
15942+
- he
15943+
- hi
15944+
- hr
15945+
- hu
15946+
- it
15947+
- ja
15948+
- ko
15949+
- ml
15950+
- nl
15951+
- nn
15952+
- "false"
15953+
- pl
15954+
- pt
15955+
- ru
15956+
- sk
15957+
- sl
15958+
- te
15959+
- tr
15960+
- uk
15961+
- ur
15962+
- vi
15963+
- zh
15964+
example: fr
15965+
type: string
15966+
transcript:
15967+
description: "Use this parameter to enable transcription. \n\n- When `true`,\
15968+
\ the API generates a transcript for the video.\n- The default value is\
15969+
\ `false`.\n- If you define a video language using the `language` parameter,\
15970+
\ the API uses that language to transcribe the video. If you do not define\
15971+
\ a language, the API detects it based on the video. \n- When the API\
15972+
\ generates a transcript, it will be available as a caption for the video."
15973+
type: boolean
1585015974
required:
1585115975
- title
1585215976
title: VideoCreationPayload
@@ -15897,6 +16021,8 @@ components:
1589716021
title: String theory
1589816022
description: An amazing video explaining the string theory
1589916023
public: false
16024+
language: en
16025+
reanscript: true
1590016026
panoramic: false
1590116027
mp4Support: true
1590216028
tags:
@@ -15951,6 +16077,55 @@ components:
1595116077
items:
1595216078
$ref: '#/components/schemas/metadata'
1595316079
type: array
16080+
language:
16081+
description: |-
16082+
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.
16083+
16084+
`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.
16085+
enum:
16086+
- ar
16087+
- ca
16088+
- cs
16089+
- da
16090+
- de
16091+
- el
16092+
- en
16093+
- es
16094+
- fa
16095+
- fi
16096+
- fr
16097+
- he
16098+
- hi
16099+
- hr
16100+
- hu
16101+
- it
16102+
- ja
16103+
- ko
16104+
- ml
16105+
- nl
16106+
- nn
16107+
- "false"
16108+
- pl
16109+
- pt
16110+
- ru
16111+
- sk
16112+
- sl
16113+
- te
16114+
- tr
16115+
- uk
16116+
- ur
16117+
- vi
16118+
- zh
16119+
example: fr
16120+
type: string
16121+
transcript:
16122+
description: "Use this parameter to enable transcription. \n\n- When `true`,\
16123+
\ the API generates a transcript for the video.\n- The default value is\
16124+
\ `false`.\n- If you define a video language using the `language` parameter,\
16125+
\ the API uses that language to transcribe the video. If you do not define\
16126+
\ a language, the API detects it based on the video. \n- When the API\
16127+
\ generates a transcript, it will be available as a caption for the video."
16128+
type: boolean
1595416129
title: VideoUpdatePayload
1595516130
type: object
1595616131
discarded-video-update-payload:

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ apply plugin: 'com.diffplug.spotless'
44
apply plugin: 'maven-publish'
55

66
group = 'video.api'
7-
version = '1.4.3'
7+
version = '1.4.4'
88

99
buildscript {
1010
repositories {

docs/Video.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Name | Type | Description | Notes
1515
**discardedAt** | **OffsetDateTime** | 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]
1616
**deletesAt** | **OffsetDateTime** | 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]
1717
**discarded** | **Boolean** | Returns &#x60;true&#x60; for videos you discarded when you have the Video Restore feature enabled. Returns &#x60;false&#x60; for every other video. | [optional]
18+
**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]
19+
**languageOrigin** | [**LanguageOriginEnum**](#LanguageOriginEnum) | Returns the origin of the last update on the video&#39;s &#x60;language&#x60; attribute. - &#x60;api&#x60; means that the last update was requested from the API. - &#x60;auto&#x60; means that the last update was done automatically by the API. | [optional]
1820
**tags** | **List&lt;String&gt;** | One array of tags (each tag is a string) in order to categorize a video. Tags may include spaces. | [optional]
1921
**metadata** | [**List&lt;Metadata&gt;**](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]
2022
**source** | [**VideoSource**](VideoSource.md) | | [optional]
@@ -25,6 +27,15 @@ Name | Type | Description | Notes
2527
**mp4Support** | **Boolean** | This lets you know whether mp4 is supported. If enabled, an mp4 URL will be provided in the response for the video. | [optional]
2628

2729

30+
31+
## Enum: LanguageOriginEnum
32+
33+
Name | Value
34+
---- | -----
35+
API | &quot;api&quot;
36+
AUTO | &quot;auto&quot;
37+
38+
2839
## Implemented Interfaces
2940

3041
* Serializable

0 commit comments

Comments
 (0)