diff options
Diffstat (limited to 'shared/extra-utils/videos')
-rw-r--r-- | shared/extra-utils/videos/live.ts | 13 |
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 | ||
131 | async function waitUntilLiveStarts (url: string, token: string, videoId: number | string) { | 131 | function waitUntilLiveStarts (url: string, token: string, videoId: number | string) { |
132 | return waitWhileLiveState(url, token, videoId, VideoState.WAITING_FOR_LIVE) | ||
133 | } | ||
134 | |||
135 | function waitUntilLivePublished (url: string, token: string, videoId: number | string) { | ||
136 | return waitWhileLiveState(url, token, videoId, VideoState.PUBLISHED) | ||
137 | } | ||
138 | |||
139 | async 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 | ||
142 | async function checkLiveCleanup (server: ServerInfo, videoUUID: string, resolutions: number[] = []) { | 150 | async function checkLiveCleanup (server: ServerInfo, videoUUID: string, resolutions: number[] = []) { |
@@ -168,6 +176,7 @@ async function checkLiveCleanup (server: ServerInfo, videoUUID: string, resoluti | |||
168 | 176 | ||
169 | export { | 177 | export { |
170 | getLive, | 178 | getLive, |
179 | waitUntilLivePublished, | ||
171 | updateLive, | 180 | updateLive, |
172 | waitUntilLiveStarts, | 181 | waitUntilLiveStarts, |
173 | createLive, | 182 | createLive, |