aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/server-commands/videos
diff options
context:
space:
mode:
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 & {