aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-06-23 10:53:16 +0200
committerChocobozzz <me@florianbigard.com>2022-06-23 10:53:16 +0200
commit64324ac646b0938e35cd88771492623b640bd0d8 (patch)
tree7d702cf4f79d5a39edcdf244d961f059d08d2105 /shared
parent2c2befaacaa7063df0d4557b71c187ee168a8eb6 (diff)
parentb6898035bfc5ba60ec54f7e61ff832e5e2ac30eb (diff)
downloadPeerTube-64324ac646b0938e35cd88771492623b640bd0d8.tar.gz
PeerTube-64324ac646b0938e35cd88771492623b640bd0d8.tar.zst
PeerTube-64324ac646b0938e35cd88771492623b640bd0d8.zip
Merge branch 'release/4.2.0' into develop
Diffstat (limited to 'shared')
-rw-r--r--shared/server-commands/server/config-command.ts9
-rw-r--r--shared/server-commands/videos/live-command.ts28
2 files changed, 30 insertions, 7 deletions
diff --git a/shared/server-commands/server/config-command.ts b/shared/server-commands/server/config-command.ts
index 5320dead4..3803aaf95 100644
--- a/shared/server-commands/server/config-command.ts
+++ b/shared/server-commands/server/config-command.ts
@@ -39,15 +39,18 @@ export class ConfigCommand extends AbstractCommand {
39 enableLive (options: { 39 enableLive (options: {
40 allowReplay?: boolean 40 allowReplay?: boolean
41 transcoding?: boolean 41 transcoding?: boolean
42 resolutions?: 'min' | 'max' // Default max
42 } = {}) { 43 } = {}) {
44 const { allowReplay, transcoding, resolutions = 'max' } = options
45
43 return this.updateExistingSubConfig({ 46 return this.updateExistingSubConfig({
44 newConfig: { 47 newConfig: {
45 live: { 48 live: {
46 enabled: true, 49 enabled: true,
47 allowReplay: options.allowReplay ?? true, 50 allowReplay: allowReplay ?? true,
48 transcoding: { 51 transcoding: {
49 enabled: options.transcoding ?? true, 52 enabled: transcoding ?? true,
50 resolutions: ConfigCommand.getCustomConfigResolutions(true) 53 resolutions: ConfigCommand.getCustomConfigResolutions(resolutions === 'max')
51 } 54 }
52 } 55 }
53 } 56 }
diff --git a/shared/server-commands/videos/live-command.ts b/shared/server-commands/videos/live-command.ts
index 2ff65881b..3df47ed4d 100644
--- a/shared/server-commands/videos/live-command.ts
+++ b/shared/server-commands/videos/live-command.ts
@@ -154,13 +154,33 @@ export class LiveCommand extends AbstractCommand {
154 154
155 waitUntilSegmentGeneration (options: OverrideCommandOptions & { 155 waitUntilSegmentGeneration (options: OverrideCommandOptions & {
156 videoUUID: string 156 videoUUID: string
157 resolution: number 157 playlistNumber: number
158 segment: number 158 segment: number
159 totalSessions?: number
159 }) { 160 }) {
160 const { resolution, segment, videoUUID } = options 161 const { playlistNumber, segment, videoUUID, totalSessions = 1 } = options
161 const segmentName = `${resolution}-00000${segment}.ts` 162 const segmentName = `${playlistNumber}-00000${segment}.ts`
162 163
163 return this.server.servers.waitUntilLog(`${videoUUID}/${segmentName}`, 2, false) 164 return this.server.servers.waitUntilLog(`${videoUUID}/${segmentName}`, totalSessions * 2, false)
165 }
166
167 getSegment (options: OverrideCommandOptions & {
168 videoUUID: string
169 playlistNumber: number
170 segment: number
171 }) {
172 const { playlistNumber, segment, videoUUID } = options
173
174 const segmentName = `${playlistNumber}-00000${segment}.ts`
175 const url = `${this.server.url}/static/streaming-playlists/hls/${videoUUID}/${segmentName}`
176
177 return this.getRawRequest({
178 ...options,
179
180 url,
181 implicitToken: false,
182 defaultExpectedStatus: HttpStatusCode.OK_200
183 })
164 } 184 }
165 185
166 async waitUntilReplacedByReplay (options: OverrideCommandOptions & { 186 async waitUntilReplacedByReplay (options: OverrideCommandOptions & {