checkLiveCleanup,
cleanupTests,
ConfigCommand,
- createLive,
doubleFollow,
flushAndRunMultipleServers,
getVideo,
getVideosList,
removeVideo,
- sendRTMPStreamInVideo,
ServerInfo,
setAccessTokensToServers,
setDefaultVideoChannel,
testFfmpegStreamError,
updateVideo,
wait,
- waitJobs,
- waitUntilLiveEnded,
- waitUntilLivePublished,
- waitUntilLiveSaved
+ waitJobs
} from '../../../../shared/extra-utils'
const expect = chai.expect
saveReplay
}
- const res = await createLive(servers[0].url, servers[0].accessToken, attributes)
- return res.body.video.uuid
+ const { uuid } = await servers[0].liveCommand.create({ fields: attributes })
+ return uuid
}
async function checkVideosExist (videoId: string, existsInList: boolean, getStatus?: number) {
async function waitUntilLivePublishedOnAllServers (videoId: string) {
for (const server of servers) {
- await waitUntilLivePublished(server.url, server.accessToken, videoId)
+ await server.liveCommand.waitUntilPublished({ videoId })
}
}
async function waitUntilLiveSavedOnAllServers (videoId: string) {
for (const server of servers) {
- await waitUntilLiveSaved(server.url, server.accessToken, videoId)
+ await server.liveCommand.waitUntilSaved({ videoId })
}
}
it('Should correctly have updated the live and federated it when streaming in the live', async function () {
this.timeout(30000)
- ffmpegCommand = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, liveVideoUUID)
+ ffmpegCommand = await servers[0].liveCommand.sendRTMPStreamInVideo({ videoId: liveVideoUUID })
await waitUntilLivePublishedOnAllServers(liveVideoUUID)
await stopFfmpeg(ffmpegCommand)
for (const server of servers) {
- await waitUntilLiveEnded(server.url, server.accessToken, liveVideoUUID)
+ await server.liveCommand.waitUntilEnded({ videoId: liveVideoUUID })
}
await waitJobs(servers)
liveVideoUUID = await createLiveWrapper(false)
- ffmpegCommand = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, liveVideoUUID)
+ ffmpegCommand = await servers[0].liveCommand.sendRTMPStreamInVideo({ videoId: liveVideoUUID })
await waitUntilLivePublishedOnAllServers(liveVideoUUID)
liveVideoUUID = await createLiveWrapper(false)
- ffmpegCommand = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, liveVideoUUID)
+ ffmpegCommand = await servers[0].liveCommand.sendRTMPStreamInVideo({ videoId: liveVideoUUID })
await waitUntilLivePublishedOnAllServers(liveVideoUUID)
it('Should correctly have updated the live and federated it when streaming in the live', async function () {
this.timeout(20000)
- ffmpegCommand = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, liveVideoUUID)
+ ffmpegCommand = await servers[0].liveCommand.sendRTMPStreamInVideo({ videoId: liveVideoUUID })
await waitUntilLivePublishedOnAllServers(liveVideoUUID)
await waitJobs(servers)
liveVideoUUID = await createLiveWrapper(true)
- ffmpegCommand = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, liveVideoUUID)
+ ffmpegCommand = await servers[0].liveCommand.sendRTMPStreamInVideo({ videoId: liveVideoUUID })
await waitUntilLivePublishedOnAllServers(liveVideoUUID)
await waitJobs(servers)
liveVideoUUID = await createLiveWrapper(true)
- ffmpegCommand = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, liveVideoUUID)
+ ffmpegCommand = await servers[0].liveCommand.sendRTMPStreamInVideo({ videoId: liveVideoUUID })
await waitUntilLivePublishedOnAllServers(liveVideoUUID)
await waitJobs(servers)