aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/server-commands/videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-06-23 10:29:43 +0200
committerChocobozzz <me@florianbigard.com>2022-06-23 10:30:48 +0200
commit53023be33af420675d0060eb95c99a8038457564 (patch)
tree699a13694b0c1c8589d10de95184708a451fcab4 /shared/server-commands/videos
parent50341c8fe988ca2a3d7c700f9aa918673dc979c2 (diff)
downloadPeerTube-53023be33af420675d0060eb95c99a8038457564.tar.gz
PeerTube-53023be33af420675d0060eb95c99a8038457564.tar.zst
PeerTube-53023be33af420675d0060eb95c99a8038457564.zip
Fix fast restream in saved permanent live
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 & {