From 40e87e9ecc54e3513fb586928330a7855eb192c6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 12 Jul 2018 19:02:00 +0200 Subject: Implement captions/subtitles --- shared/models/activitypub/objects/video-torrent-object.ts | 1 + shared/models/server/custom-config.model.ts | 4 ++++ shared/models/server/server-config.model.ts | 9 +++++++++ shared/models/videos/index.ts | 2 ++ shared/models/videos/video-caption-update.model.ts | 4 ++++ shared/models/videos/video-caption.model.ts | 6 ++++++ shared/models/videos/video-constant.model.ts | 4 ++++ shared/models/videos/video.model.ts | 6 +----- 8 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 shared/models/videos/video-caption-update.model.ts create mode 100644 shared/models/videos/video-caption.model.ts create mode 100644 shared/models/videos/video-constant.model.ts (limited to 'shared/models') diff --git a/shared/models/activitypub/objects/video-torrent-object.ts b/shared/models/activitypub/objects/video-torrent-object.ts index c4071a6d9..90de8967b 100644 --- a/shared/models/activitypub/objects/video-torrent-object.ts +++ b/shared/models/activitypub/objects/video-torrent-object.ts @@ -17,6 +17,7 @@ export interface VideoTorrentObject { category: ActivityIdentifierObject licence: ActivityIdentifierObject language: ActivityIdentifierObject + subtitleLanguage: ActivityIdentifierObject[] views: number sensitive: boolean commentsEnabled: boolean diff --git a/shared/models/server/custom-config.model.ts b/shared/models/server/custom-config.model.ts index a3a651cd8..9c4718e43 100644 --- a/shared/models/server/custom-config.model.ts +++ b/shared/models/server/custom-config.model.ts @@ -25,6 +25,10 @@ export interface CustomConfig { previews: { size: number } + + captions: { + size: number + } } signup: { diff --git a/shared/models/server/server-config.model.ts b/shared/models/server/server-config.model.ts index da0996dae..217d142cd 100644 --- a/shared/models/server/server-config.model.ts +++ b/shared/models/server/server-config.model.ts @@ -44,6 +44,15 @@ export interface ServerConfig { } } + videoCaption: { + file: { + size: { + max: number + }, + extensions: string[] + } + } + user: { videoQuota: number } diff --git a/shared/models/videos/index.ts b/shared/models/videos/index.ts index 9edfb559a..cb9669772 100644 --- a/shared/models/videos/index.ts +++ b/shared/models/videos/index.ts @@ -14,3 +14,5 @@ export * from './video-resolution.enum' export * from './video-update.model' export * from './video.model' export * from './video-state.enum' +export * from './video-caption-update.model' +export { VideoConstant } from './video-constant.model' diff --git a/shared/models/videos/video-caption-update.model.ts b/shared/models/videos/video-caption-update.model.ts new file mode 100644 index 000000000..ff5728715 --- /dev/null +++ b/shared/models/videos/video-caption-update.model.ts @@ -0,0 +1,4 @@ +export interface VideoCaptionUpdate { + language: string + captionfile: Blob +} diff --git a/shared/models/videos/video-caption.model.ts b/shared/models/videos/video-caption.model.ts new file mode 100644 index 000000000..4695224ce --- /dev/null +++ b/shared/models/videos/video-caption.model.ts @@ -0,0 +1,6 @@ +import { VideoConstant } from './video-constant.model' + +export interface VideoCaption { + language: VideoConstant + captionPath: string +} diff --git a/shared/models/videos/video-constant.model.ts b/shared/models/videos/video-constant.model.ts new file mode 100644 index 000000000..342a7c0cf --- /dev/null +++ b/shared/models/videos/video-constant.model.ts @@ -0,0 +1,4 @@ +export interface VideoConstant { + id: T + label: string +} diff --git a/shared/models/videos/video.model.ts b/shared/models/videos/video.model.ts index 4e1f15ee3..f7bbaac76 100644 --- a/shared/models/videos/video.model.ts +++ b/shared/models/videos/video.model.ts @@ -4,11 +4,7 @@ import { Avatar } from '../avatars/avatar.model' import { VideoChannel } from './video-channel.model' import { VideoPrivacy } from './video-privacy.enum' import { VideoScheduleUpdate } from './video-schedule-update.model' - -export interface VideoConstant { - id: T - label: string -} +import { VideoConstant } from './video-constant.model' export interface VideoFile { magnetUri: string -- cgit v1.2.3