+ async function publishLive (options: { permanent: boolean, replay: boolean }) {
+ liveVideoUUID = await createLiveWrapper(options)
+
+ const ffmpegCommand = await servers[0].live.sendRTMPStreamInVideo({ videoId: liveVideoUUID })
+ await waitUntilLivePublishedOnAllServers(servers, liveVideoUUID)
+
+ const liveDetails = await servers[0].videos.get({ id: liveVideoUUID })
+
+ await waitJobs(servers)
+ await checkVideosExist(liveVideoUUID, true, HttpStatusCode.OK_200)
+
+ return { ffmpegCommand, liveDetails }
+ }
+
+ async function publishLiveAndDelete (options: { permanent: boolean, replay: boolean }) {
+ const { ffmpegCommand, liveDetails } = await publishLive(options)
+
+ await Promise.all([
+ servers[0].videos.remove({ id: liveVideoUUID }),
+ testFfmpegStreamError(ffmpegCommand, true)
+ ])
+
+ await waitJobs(servers)
+ await wait(5000)
+ await waitJobs(servers)
+
+ return { liveDetails }
+ }
+
+ async function publishLiveAndBlacklist (options: { permanent: boolean, replay: boolean }) {
+ const { ffmpegCommand, liveDetails } = await publishLive(options)
+
+ await Promise.all([
+ servers[0].blacklist.add({ videoId: liveVideoUUID, reason: 'bad live', unfederate: true }),
+ testFfmpegStreamError(ffmpegCommand, true)
+ ])
+
+ await waitJobs(servers)
+ await wait(5000)
+ await waitJobs(servers)
+
+ return { liveDetails }
+ }
+