Refactor live manager

This commit is contained in:
Chocobozzz
2021-06-16 15:14:41 +02:00
parent fd6584844b
commit 8ebf2a5d5d
23 changed files with 1255 additions and 886 deletions

View File

@@ -175,6 +175,12 @@ async function waitUntilLiveSaved (url: string, token: string, videoId: number |
} while (video.isLive === true && video.state.id !== VideoState.PUBLISHED)
}
async function waitUntilLivePublishedOnAllServers (servers: ServerInfo[], videoId: string) {
for (const server of servers) {
await waitUntilLivePublished(server.url, server.accessToken, videoId)
}
}
async function checkLiveCleanup (server: ServerInfo, videoUUID: string, resolutions: number[] = []) {
const basePath = buildServerDirectory(server, 'streaming-playlists')
const hlsPath = join(basePath, 'hls', videoUUID)
@@ -226,6 +232,7 @@ export {
sendRTMPStreamInVideo,
waitUntilLiveEnded,
waitFfmpegUntilError,
waitUntilLivePublishedOnAllServers,
sendRTMPStream,
testFfmpegStreamError
}