Skip to content

Commit 84cf0e4

Browse files
author
olivierapivideo
authored
Add transcript feature
1 parent b52fb91 commit 84cf0e4

File tree

9 files changed

+28
-8
lines changed

9 files changed

+28
-8
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
49fece4f39cb92341dc77e0eb7371a152903bf6aebcfa250d289efc9018b0f72
1+
89e46e80ced45a858d27653ed3fea2a27e486116fca3e94367027fdb92105246

ApiVideoUploader.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ Pod::Spec.new do |s|
55
s.tvos.deployment_target = '10.0'
66
# Add back when CocoaPods/CocoaPods#11558 is released
77
#s.watchos.deployment_target = '3.0'
8-
s.version = '1.2.3'
9-
s.source = { :git => 'https://github.com/apivideo/api.video-swift-uploader', :tag => 'v1.2.3' }
8+
s.version = '1.2.4'
9+
s.source = { :git => 'https://github.com/apivideo/api.video-swift-uploader', :tag => 'v1.2.4' }
1010
s.authors = { 'Ecosystem Team' => 'ecosystem@api.video' }
1111
s.license = { :type => 'MIT' }
1212
s.homepage = 'https://docs.api.video'

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.2.4] - 2024-10-08
5+
- Add transcript feature
6+
47
## [1.2.3] - 2024-04-25
58
- Add API to get rate limiting headers
69

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ It allows you to upload videos in two ways:
5252
Specify it in your `Cartfile`:
5353

5454
```
55-
github "apivideo/api.video-swift-uploader" ~> 1.2.3
55+
github "apivideo/api.video-swift-uploader" ~> 1.2.4
5656
```
5757

5858
Run `carthage update`
5959

6060
#### CocoaPods
6161

62-
Add `pod 'ApiVideoUploader', '1.2.3'` in your `Podfile`
62+
Add `pod 'ApiVideoUploader', '1.2.4'` in your `Podfile`
6363

6464
Run `pod install`
6565

Sources/APIs.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Foundation
88
public class ApiVideoUploader {
99
public static var apiKey: String? = nil
1010
public static var basePath = "https://ws.api.video"
11-
internal static var customHeaders:[String: String] = ["AV-Origin-Client": "swift-uploader:1.2.3"]
11+
internal static var customHeaders:[String: String] = ["AV-Origin-Client": "swift-uploader:1.2.4"]
1212
private static var chunkSize: Int = 50 * 1024 * 1024
1313
internal static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory()
1414
internal static var credential = ApiVideoCredential()

Sources/Models/Video.swift

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ import AnyCodable
1212

1313
public struct Video: Codable, Hashable {
1414

15+
public enum LanguageOrigin: String, Codable, CaseIterable {
16+
case api = "api"
17+
case auto = "auto"
18+
}
1519
/** The unique identifier of the video object. */
1620
public var videoId: String
1721
/** When a video was created, presented in ATOM UTC format. */
@@ -30,6 +34,10 @@ public struct Video: Codable, Hashable {
3034
public var deletesAt: Date?
3135
/** Returns `true` for videos you discarded when you have the Video Restore feature enabled. Returns `false` for every other video. */
3236
public var discarded: Bool?
37+
/** 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. */
38+
public var language: String?
39+
/** 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. */
40+
public var languageOrigin: LanguageOrigin?
3341
/** One array of tags (each tag is a string) in order to categorize a video. Tags may include spaces. */
3442
public var tags: [String]?
3543
/** 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. */
@@ -45,7 +53,7 @@ public struct Video: Codable, Hashable {
4553
/** This lets you know whether mp4 is supported. If enabled, an mp4 URL will be provided in the response for the video. */
4654
public var mp4Support: Bool?
4755

48-
public init(videoId: String, createdAt: Date? = nil, title: String? = nil, description: String? = nil, publishedAt: Date? = nil, updatedAt: Date? = nil, discardedAt: Date? = nil, deletesAt: Date? = nil, discarded: Bool? = nil, tags: [String]? = nil, metadata: [Metadata]? = nil, source: VideoSource? = nil, assets: VideoAssets? = nil, playerId: String? = nil, _public: Bool? = nil, panoramic: Bool? = nil, mp4Support: Bool? = nil) {
56+
public init(videoId: String, createdAt: Date? = nil, title: String? = nil, description: String? = nil, publishedAt: Date? = nil, updatedAt: Date? = nil, discardedAt: Date? = nil, deletesAt: Date? = nil, discarded: Bool? = nil, language: String? = nil, languageOrigin: LanguageOrigin? = nil, tags: [String]? = nil, metadata: [Metadata]? = nil, source: VideoSource? = nil, assets: VideoAssets? = nil, playerId: String? = nil, _public: Bool? = nil, panoramic: Bool? = nil, mp4Support: Bool? = nil) {
4957
self.videoId = videoId
5058
self.createdAt = createdAt
5159
self.title = title
@@ -55,6 +63,8 @@ public struct Video: Codable, Hashable {
5563
self.discardedAt = discardedAt
5664
self.deletesAt = deletesAt
5765
self.discarded = discarded
66+
self.language = language
67+
self.languageOrigin = languageOrigin
5868
self.tags = tags
5969
self.metadata = metadata
6070
self.source = source
@@ -75,6 +85,8 @@ public struct Video: Codable, Hashable {
7585
case discardedAt
7686
case deletesAt
7787
case discarded
88+
case language
89+
case languageOrigin
7890
case tags
7991
case metadata
8092
case source
@@ -98,6 +110,8 @@ public struct Video: Codable, Hashable {
98110
try container.encodeIfPresent(discardedAt, forKey: .discardedAt)
99111
try container.encodeIfPresent(deletesAt, forKey: .deletesAt)
100112
try container.encodeIfPresent(discarded, forKey: .discarded)
113+
try container.encodeIfPresent(language, forKey: .language)
114+
try container.encodeIfPresent(languageOrigin, forKey: .languageOrigin)
101115
try container.encodeIfPresent(tags, forKey: .tags)
102116
try container.encodeIfPresent(metadata, forKey: .metadata)
103117
try container.encodeIfPresent(source, forKey: .source)

Tests/TestResources/payloads/videos/uploadWithUploadToken/responses/201.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"playerId" : "pl45KFKdlddgk654dspkze",
44
"title" : "Maths video",
55
"description" : "An amazing video explaining the string theory",
6+
"language" : "en",
67
"public" : false,
78
"panoramic" : false,
89
"tags" : [ "maths", "string theory", "video" ],

docs/Video.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Name | Type | Description | Notes
1212
**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]
1313
**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]
1414
**discarded** | **Bool** | Returns `true` for videos you discarded when you have the Video Restore feature enabled. Returns `false` for every other video. | [optional]
15+
**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]
16+
**languageOrigin** | **String** | 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]
1517
**tags** | **[String]** | One array of tags (each tag is a string) in order to categorize a video. Tags may include spaces. | [optional]
1618
**metadata** | [Metadata] | 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]
1719
**source** | [**VideoSource**](VideoSource.md) | | [optional]

project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ targets:
77
sources: [Sources]
88
info:
99
path: ./Info.plist
10-
version: 1.2.3
10+
version: 1.2.4
1111
settings:
1212
APPLICATION_EXTENSION_API_ONLY: true
1313
scheme: {}

0 commit comments

Comments
 (0)