diff options
author | Chocobozzz <me@florianbigard.com> | 2020-11-24 16:29:39 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-11-25 10:07:51 +0100 |
commit | 6b67897e2eab96978daee40aeaf716835856d65d (patch) | |
tree | 2a203bf589599061a62c4e42b0e580a1c61b47ee /shared/extra-utils | |
parent | 33ff70baa64c6315856066682595878a27b7ed8c (diff) | |
download | PeerTube-6b67897e2eab96978daee40aeaf716835856d65d.tar.gz PeerTube-6b67897e2eab96978daee40aeaf716835856d65d.tar.zst PeerTube-6b67897e2eab96978daee40aeaf716835856d65d.zip |
Add transcoding module comments
Diffstat (limited to 'shared/extra-utils')
-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, |