diff options
author | Chocobozzz <me@florianbigard.com> | 2022-03-04 13:40:02 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2022-03-09 09:23:10 +0100 |
commit | f443a74649174b2f9347c158e30f8ac7aa3e958a (patch) | |
tree | e423bc4e2307477bda4341037b7fa04ad10adae6 /shared/models | |
parent | 01dd04cd5ab7b55d2a9af7d0ebf405bee9579b09 (diff) | |
download | PeerTube-f443a74649174b2f9347c158e30f8ac7aa3e958a.tar.gz PeerTube-f443a74649174b2f9347c158e30f8ac7aa3e958a.tar.zst PeerTube-f443a74649174b2f9347c158e30f8ac7aa3e958a.zip |
Add latency setting support
Diffstat (limited to 'shared/models')
8 files changed, 26 insertions, 2 deletions
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 { | |||
5 | ActivityTagObject, | 5 | ActivityTagObject, |
6 | ActivityUrlObject | 6 | ActivityUrlObject |
7 | } from './common-objects' | 7 | } from './common-objects' |
8 | import { VideoState } from '../../videos' | 8 | import { LiveVideoLatencyMode, VideoState } from '../../videos' |
9 | 9 | ||
10 | export interface VideoObject { | 10 | export interface VideoObject { |
11 | type: 'Video' | 11 | type: 'Video' |
@@ -25,6 +25,7 @@ export interface VideoObject { | |||
25 | isLiveBroadcast: boolean | 25 | isLiveBroadcast: boolean |
26 | liveSaveReplay: boolean | 26 | liveSaveReplay: boolean |
27 | permanentLive: boolean | 27 | permanentLive: boolean |
28 | latencyMode: LiveVideoLatencyMode | ||
28 | 29 | ||
29 | commentsEnabled: boolean | 30 | commentsEnabled: boolean |
30 | downloadEnabled: boolean | 31 | 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 { | |||
131 | 131 | ||
132 | allowReplay: boolean | 132 | allowReplay: boolean |
133 | 133 | ||
134 | latencySetting: { | ||
135 | enabled: boolean | ||
136 | } | ||
137 | |||
134 | maxDuration: number | 138 | maxDuration: number |
135 | maxInstanceLives: number | 139 | maxInstanceLives: number |
136 | maxUserLives: number | 140 | 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 { | |||
149 | live: { | 149 | live: { |
150 | enabled: boolean | 150 | enabled: boolean |
151 | 151 | ||
152 | allowReplay: boolean | ||
153 | latencySetting: { | ||
154 | enabled: boolean | ||
155 | } | ||
156 | |||
152 | maxDuration: number | 157 | maxDuration: number |
153 | maxInstanceLives: number | 158 | maxInstanceLives: number |
154 | maxUserLives: number | 159 | maxUserLives: number |
155 | allowReplay: boolean | ||
156 | 160 | ||
157 | transcoding: { | 161 | transcoding: { |
158 | enabled: boolean | 162 | 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 @@ | |||
1 | export * from './live-video-create.model' | 1 | export * from './live-video-create.model' |
2 | export * from './live-video-event-payload.model' | 2 | export * from './live-video-event-payload.model' |
3 | export * from './live-video-event.type' | 3 | export * from './live-video-event.type' |
4 | export * from './live-video-latency-mode.enum' | ||
4 | export * from './live-video-update.model' | 5 | export * from './live-video-update.model' |
5 | export * from './live-video.model' | 6 | 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 @@ | |||
1 | import { LiveVideoLatencyMode } from '.' | ||
1 | import { VideoCreate } from '../video-create.model' | 2 | import { VideoCreate } from '../video-create.model' |
2 | 3 | ||
3 | export interface LiveVideoCreate extends VideoCreate { | 4 | export interface LiveVideoCreate extends VideoCreate { |
4 | saveReplay?: boolean | 5 | saveReplay?: boolean |
5 | permanentLive?: boolean | 6 | permanentLive?: boolean |
7 | latencyMode?: LiveVideoLatencyMode | ||
6 | } | 8 | } |
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 @@ | |||
1 | export const enum LiveVideoLatencyMode { | ||
2 | DEFAULT = 1, | ||
3 | HIGH_LATENCY = 2, | ||
4 | SMALL_LATENCY = 3 | ||
5 | } | ||
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 @@ | |||
1 | import { LiveVideoLatencyMode } from './live-video-latency-mode.enum' | ||
2 | |||
1 | export interface LiveVideoUpdate { | 3 | export interface LiveVideoUpdate { |
2 | permanentLive?: boolean | 4 | permanentLive?: boolean |
3 | saveReplay?: boolean | 5 | saveReplay?: boolean |
6 | latencyMode?: LiveVideoLatencyMode | ||
4 | } | 7 | } |
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 @@ | |||
1 | import { LiveVideoLatencyMode } from './live-video-latency-mode.enum' | ||
2 | |||
1 | export interface LiveVideo { | 3 | export interface LiveVideo { |
2 | rtmpUrl: string | 4 | rtmpUrl: string |
3 | rtmpsUrl: string | 5 | rtmpsUrl: string |
4 | 6 | ||
5 | streamKey: string | 7 | streamKey: string |
8 | |||
6 | saveReplay: boolean | 9 | saveReplay: boolean |
7 | permanentLive: boolean | 10 | permanentLive: boolean |
11 | latencyMode: LiveVideoLatencyMode | ||
8 | } | 12 | } |