aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/server-commands/videos
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/server-commands/videos
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/server-commands/videos')
-rw-r--r--shared/server-commands/videos/live-command.ts28
1 files changed, 24 insertions, 4 deletions
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 & {