}
function waitFfmpegUntilError (command: ffmpeg.FfmpegCommand, successAfterMS = 10000) {
- return new Promise((res, rej) => {
+ return new Promise<void>((res, rej) => {
command.on('error', err => {
return rej(err)
})
let error: Error
try {
- await waitFfmpegUntilError(command, 25000)
+ await waitFfmpegUntilError(command, 35000)
} catch (err) {
error = err
}
} while (video.state.id !== state)
}
+async function waitUntilLiveSaved (url: string, token: string, videoId: number | string) {
+ let video: VideoDetails
+
+ do {
+ const res = await getVideoWithToken(url, token, videoId)
+ video = res.body
+
+ await wait(500)
+ } while (video.isLive === true && video.state.id !== VideoState.PUBLISHED)
+}
+
async function checkLiveCleanup (server: ServerInfo, videoUUID: string, resolutions: number[] = []) {
const basePath = buildServerDirectory(server, 'streaming-playlists')
const hlsPath = join(basePath, 'hls', videoUUID)
export {
getLive,
getPlaylistsCount,
+ waitUntilLiveSaved,
waitUntilLivePublished,
updateLive,
createLive,