aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils
diff options
context:
space:
mode:
Diffstat (limited to 'shared/extra-utils')
-rw-r--r--shared/extra-utils/videos/live.ts13
1 files changed, 11 insertions, 2 deletions
diff --git a/shared/extra-utils/videos/live.ts b/shared/extra-utils/videos/live.ts
index 85c83c5bb..c8acb90da 100644
--- a/shared/extra-utils/videos/live.ts
+++ b/shared/extra-utils/videos/live.ts
@@ -128,7 +128,15 @@ async function stopFfmpeg (command: ffmpeg.FfmpegCommand) {
128 await wait(500) 128 await wait(500)
129} 129}
130 130
131async function waitUntilLiveStarts (url: string, token: string, videoId: number | string) { 131function waitUntilLiveStarts (url: string, token: string, videoId: number | string) {
132 return waitWhileLiveState(url, token, videoId, VideoState.WAITING_FOR_LIVE)
133}
134
135function waitUntilLivePublished (url: string, token: string, videoId: number | string) {
136 return waitWhileLiveState(url, token, videoId, VideoState.PUBLISHED)
137}
138
139async function waitWhileLiveState (url: string, token: string, videoId: number | string, state: VideoState) {
132 let video: VideoDetails 140 let video: VideoDetails
133 141
134 do { 142 do {
@@ -136,7 +144,7 @@ async function waitUntilLiveStarts (url: string, token: string, videoId: number
136 video = res.body 144 video = res.body
137 145
138 await wait(500) 146 await wait(500)
139 } while (video.state.id === VideoState.WAITING_FOR_LIVE) 147 } while (video.state.id === state)
140} 148}
141 149
142async function checkLiveCleanup (server: ServerInfo, videoUUID: string, resolutions: number[] = []) { 150async function checkLiveCleanup (server: ServerInfo, videoUUID: string, resolutions: number[] = []) {
@@ -168,6 +176,7 @@ async function checkLiveCleanup (server: ServerInfo, videoUUID: string, resoluti
168 176
169export { 177export {
170 getLive, 178 getLive,
179 waitUntilLivePublished,
171 updateLive, 180 updateLive,
172 waitUntilLiveStarts, 181 waitUntilLiveStarts,
173 createLive, 182 createLive,