From f443a74649174b2f9347c158e30f8ac7aa3e958a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 4 Mar 2022 13:40:02 +0100 Subject: Add latency setting support --- shared/models/activitypub/objects/video-torrent-object.ts | 3 ++- shared/models/server/custom-config.model.ts | 4 ++++ shared/models/server/server-config.model.ts | 6 +++++- shared/models/videos/live/index.ts | 1 + shared/models/videos/live/live-video-create.model.ts | 2 ++ shared/models/videos/live/live-video-latency-mode.enum.ts | 5 +++++ shared/models/videos/live/live-video-update.model.ts | 3 +++ shared/models/videos/live/live-video.model.ts | 4 ++++ 8 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 shared/models/videos/live/live-video-latency-mode.enum.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 9faa3bb87..23d54bdbd 100644 --- a/shared/models/activitypub/objects/video-torrent-object.ts +++ b/shared/models/activitypub/objects/video-torrent-object.ts @@ -5,7 +5,7 @@ import { ActivityTagObject, ActivityUrlObject } from './common-objects' -import { VideoState } from '../../videos' +import { LiveVideoLatencyMode, VideoState } from '../../videos' export interface VideoObject { type: 'Video' @@ -25,6 +25,7 @@ export interface VideoObject { isLiveBroadcast: boolean liveSaveReplay: boolean permanentLive: boolean + latencyMode: LiveVideoLatencyMode commentsEnabled: boolean downloadEnabled: boolean diff --git a/shared/models/server/custom-config.model.ts b/shared/models/server/custom-config.model.ts index c9e7654de..5df606566 100644 --- a/shared/models/server/custom-config.model.ts +++ b/shared/models/server/custom-config.model.ts @@ -131,6 +131,10 @@ export interface CustomConfig { allowReplay: boolean + latencySetting: { + enabled: boolean + } + maxDuration: number maxInstanceLives: number maxUserLives: number diff --git a/shared/models/server/server-config.model.ts b/shared/models/server/server-config.model.ts index b06019bb8..d7fbed13c 100644 --- a/shared/models/server/server-config.model.ts +++ b/shared/models/server/server-config.model.ts @@ -149,10 +149,14 @@ export interface ServerConfig { live: { enabled: boolean + allowReplay: boolean + latencySetting: { + enabled: boolean + } + maxDuration: number maxInstanceLives: number maxUserLives: number - allowReplay: boolean transcoding: { enabled: boolean diff --git a/shared/models/videos/live/index.ts b/shared/models/videos/live/index.ts index a36f42a7d..68f32092a 100644 --- a/shared/models/videos/live/index.ts +++ b/shared/models/videos/live/index.ts @@ -1,5 +1,6 @@ export * from './live-video-create.model' export * from './live-video-event-payload.model' export * from './live-video-event.type' +export * from './live-video-latency-mode.enum' export * from './live-video-update.model' export * from './live-video.model' diff --git a/shared/models/videos/live/live-video-create.model.ts b/shared/models/videos/live/live-video-create.model.ts index caa7acc17..49ccaf45b 100644 --- a/shared/models/videos/live/live-video-create.model.ts +++ b/shared/models/videos/live/live-video-create.model.ts @@ -1,6 +1,8 @@ +import { LiveVideoLatencyMode } from '.' import { VideoCreate } from '../video-create.model' export interface LiveVideoCreate extends VideoCreate { saveReplay?: boolean permanentLive?: boolean + latencyMode?: LiveVideoLatencyMode } diff --git a/shared/models/videos/live/live-video-latency-mode.enum.ts b/shared/models/videos/live/live-video-latency-mode.enum.ts new file mode 100644 index 000000000..4285e1d41 --- /dev/null +++ b/shared/models/videos/live/live-video-latency-mode.enum.ts @@ -0,0 +1,5 @@ +export const enum LiveVideoLatencyMode { + DEFAULT = 1, + HIGH_LATENCY = 2, + SMALL_LATENCY = 3 +} diff --git a/shared/models/videos/live/live-video-update.model.ts b/shared/models/videos/live/live-video-update.model.ts index a39c44797..93bb4d30d 100644 --- a/shared/models/videos/live/live-video-update.model.ts +++ b/shared/models/videos/live/live-video-update.model.ts @@ -1,4 +1,7 @@ +import { LiveVideoLatencyMode } from './live-video-latency-mode.enum' + export interface LiveVideoUpdate { permanentLive?: boolean saveReplay?: boolean + latencyMode?: LiveVideoLatencyMode } diff --git a/shared/models/videos/live/live-video.model.ts b/shared/models/videos/live/live-video.model.ts index 815a93804..2d3169941 100644 --- a/shared/models/videos/live/live-video.model.ts +++ b/shared/models/videos/live/live-video.model.ts @@ -1,8 +1,12 @@ +import { LiveVideoLatencyMode } from './live-video-latency-mode.enum' + export interface LiveVideo { rtmpUrl: string rtmpsUrl: string streamKey: string + saveReplay: boolean permanentLive: boolean + latencyMode: LiveVideoLatencyMode } -- cgit v1.2.3