Skip to content

Commit

Permalink
Merge pull request #100 from apivideo/add-transcript-feature
Browse files Browse the repository at this point in the history
Add transcript feature
  • Loading branch information
bot-api-video authored Oct 8, 2024
2 parents 6fbc14b + a86f2e5 commit 7a847b8
Show file tree
Hide file tree
Showing 9 changed files with 153 additions and 13 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog
All changes to this project will be documented in this file.

## [1.3.7] - 2024-10-08
- Add transcript feature

## [1.3.6] - 2024-04-25
- Add API to get rate limiting headers

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Add this dependency to your project's POM:
<dependency>
<groupId>video.api</groupId>
<artifactId>android-video-uploader</artifactId>
<version>1.3.6</version>
<version>1.3.7</version>
<scope>compile</scope>
</dependency>
```
Expand All @@ -72,7 +72,7 @@ Add this dependency to your project's POM:
Add this dependency to your project's build file:

```groovy
implementation "video.api:android-video-uploader:1.3.6"
implementation "video.api:android-video-uploader:1.3.7"
```

#### Others
Expand All @@ -85,7 +85,7 @@ mvn clean package

Then manually install the following JARs:

* `target/android-video-uploader-1.3.6.jar`
* `target/android-video-uploader-1.3.7.jar`
* `target/lib/*.jar`

### Code sample
Expand Down
19 changes: 19 additions & 0 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,7 @@ paths:
playerId: pl45KFKdlddgk654dspkze
title: Maths video
description: An amazing video explaining the string theory
language: en
public: false
panoramic: false
tags:
Expand Down Expand Up @@ -1049,6 +1050,8 @@ components:
videoId: vi4k0jvEUuaTdRAEjQ4Jfrgz
title: Maths video
description: An amazing video explaining the string theory
language: en
languageOrigin: api
tags:
- maths
- string theory
Expand Down Expand Up @@ -1120,6 +1123,22 @@ components:
description: Returns `true` for videos you discarded when you have the Video
Restore feature enabled. Returns `false` for every other video.
type: boolean
language:
description: 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.
type: string
languageOrigin:
description: |-
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.
enum:
- api
- auto
nullable: true
type: string
tags:
description: "One array of tags (each tag is a string) in order to categorize\
\ a video. Tags may include spaces. \n"
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apply plugin: 'maven-publish'
apply plugin: 'kotlin-android'

group = 'video.api'
version = '1.3.6'
version = '1.3.7'

buildscript {
repositories {
Expand Down
11 changes: 11 additions & 0 deletions docs/Video.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Name | Type | Description | Notes
**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]
**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]
**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]
**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]
**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]
**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]
**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]
**source** | [**VideoSource**](VideoSource.md) | | [optional]
Expand All @@ -25,6 +27,15 @@ Name | Type | Description | Notes
**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]



## Enum: LanguageOriginEnum

Name | Value
---- | -----
API | &quot;api&quot;
AUTO | &quot;auto&quot;


## Implemented Interfaces

* Serializable
Expand Down
4 changes: 2 additions & 2 deletions maven-push.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ apply plugin: 'maven-publish'
apply plugin: 'signing'

def isReleaseBuild() {
return !"1.3.6".contains("SNAPSHOT")
return !"1.3.7".contains("SNAPSHOT")
}

def getReleaseRepositoryUrl() {
Expand Down Expand Up @@ -57,7 +57,7 @@ afterEvaluate {

groupId = "video.api"
artifactId = "android-video-uploader"
version = "1.3.6"
version = "1.3.7"

pom {
name = "video.api:android-video-uploader"
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<artifactId>android-video-uploader</artifactId>
<packaging>jar</packaging>
<name>${project.groupId}:${project.artifactId}</name>
<version>1.3.6</version>
<version>1.3.7</version>
<url>https://github.com/apivideo/api.video-android-uploader</url>
<description>The official Android api.video uploader</description>
<scm>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/video/api/uploader/api/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private OkHttpClient initHttpClient(List<Interceptor> interceptors) {
private void init() {
verifyingSsl = true;
json = new JSON();
addDefaultHeader("AV-Origin-Client", "android-uploader:1.3.6");
addDefaultHeader("AV-Origin-Client", "android-uploader:1.3.7");
}

private boolean isValid(String regex, String field) {
Expand Down
117 changes: 112 additions & 5 deletions src/main/java/video/api/uploader/api/models/Video.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,63 @@ public class Video implements Serializable, DeepObject {
@SerializedName(SERIALIZED_NAME_DISCARDED)
private Boolean discarded;

public static final String SERIALIZED_NAME_LANGUAGE = "language";
@SerializedName(SERIALIZED_NAME_LANGUAGE)
private String language;

/**
* 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.
*/
@JsonAdapter(LanguageOriginEnum.Adapter.class)
public enum LanguageOriginEnum {
API("api"),

AUTO("auto");

private String value;

LanguageOriginEnum(String value) {
this.value = value;
}

public String getValue() {
return value;
}

@Override
public String toString() {
return String.valueOf(value);
}

public static LanguageOriginEnum fromValue(String value) {
for (LanguageOriginEnum b : LanguageOriginEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
return null;
}

public static class Adapter extends TypeAdapter<LanguageOriginEnum> {
@Override
public void write(final JsonWriter jsonWriter, final LanguageOriginEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}

@Override
public LanguageOriginEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return LanguageOriginEnum.fromValue(value);
}
}
}

public static final String SERIALIZED_NAME_LANGUAGE_ORIGIN = "languageOrigin";
@SerializedName(SERIALIZED_NAME_LANGUAGE_ORIGIN)
private LanguageOriginEnum languageOrigin;

public static final String SERIALIZED_NAME_TAGS = "tags";
@SerializedName(SERIALIZED_NAME_TAGS)
private List<String> tags = null;
Expand Down Expand Up @@ -296,6 +353,51 @@ public void setDiscarded(Boolean discarded) {
this.discarded = discarded;
}

public Video language(String language) {
this.language = language;
return this;
}

/**
* 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.
*
* @return language
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "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.")

public String getLanguage() {
return language;
}

public void setLanguage(String language) {
this.language = language;
}

public Video languageOrigin(LanguageOriginEnum languageOrigin) {
this.languageOrigin = languageOrigin;
return this;
}

/**
* 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.
*
* @return languageOrigin
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "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.")

public LanguageOriginEnum getLanguageOrigin() {
return languageOrigin;
}

public void setLanguageOrigin(LanguageOriginEnum languageOrigin) {
this.languageOrigin = languageOrigin;
}

public Video tags(List<String> tags) {
this.tags = tags;
return this;
Expand Down Expand Up @@ -498,16 +600,19 @@ public boolean equals(Object o) {
&& Objects.equals(this.updatedAt, video.updatedAt)
&& Objects.equals(this.discardedAt, video.discardedAt)
&& Objects.equals(this.deletesAt, video.deletesAt) && Objects.equals(this.discarded, video.discarded)
&& Objects.equals(this.tags, video.tags) && Objects.equals(this.metadata, video.metadata)
&& Objects.equals(this.source, video.source) && Objects.equals(this.assets, video.assets)
&& Objects.equals(this.playerId, video.playerId) && Objects.equals(this._public, video._public)
&& Objects.equals(this.panoramic, video.panoramic) && Objects.equals(this.mp4Support, video.mp4Support);
&& Objects.equals(this.language, video.language)
&& Objects.equals(this.languageOrigin, video.languageOrigin) && Objects.equals(this.tags, video.tags)
&& Objects.equals(this.metadata, video.metadata) && Objects.equals(this.source, video.source)
&& Objects.equals(this.assets, video.assets) && Objects.equals(this.playerId, video.playerId)
&& Objects.equals(this._public, video._public) && Objects.equals(this.panoramic, video.panoramic)
&& Objects.equals(this.mp4Support, video.mp4Support);
}

@Override
public int hashCode() {
return Objects.hash(videoId, createdAt, title, description, publishedAt, updatedAt, discardedAt, deletesAt,
discarded, tags, metadata, source, assets, playerId, _public, panoramic, mp4Support);
discarded, language, languageOrigin, tags, metadata, source, assets, playerId, _public, panoramic,
mp4Support);
}

@Override
Expand All @@ -523,6 +628,8 @@ public String toString() {
sb.append(" discardedAt: ").append(toIndentedString(discardedAt)).append("\n");
sb.append(" deletesAt: ").append(toIndentedString(deletesAt)).append("\n");
sb.append(" discarded: ").append(toIndentedString(discarded)).append("\n");
sb.append(" language: ").append(toIndentedString(language)).append("\n");
sb.append(" languageOrigin: ").append(toIndentedString(languageOrigin)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n");
sb.append(" source: ").append(toIndentedString(source)).append("\n");
Expand Down

0 comments on commit 7a847b8

Please sign in to comment.