describe('Test live', function () {
let servers: ServerInfo[] = []
+ async function waitUntilLivePublishedOnAllServers (videoId: string) {
+ for (const server of servers) {
+ await waitUntilLivePublished(server.url, server.accessToken, videoId)
+ }
+ }
+
before(async function () {
this.timeout(120000)
})
it('Should enable transcoding without additional resolutions', async function () {
- this.timeout(30000)
+ this.timeout(60000)
liveVideoId = await createLiveWrapper(false)
const command = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, liveVideoId)
- await waitUntilLivePublished(servers[0].url, servers[0].accessToken, liveVideoId)
+ await waitUntilLivePublishedOnAllServers(liveVideoId)
await waitJobs(servers)
await testVideoResolutions(liveVideoId, [ 720 ])
})
it('Should enable transcoding with some resolutions', async function () {
- this.timeout(30000)
+ this.timeout(60000)
const resolutions = [ 240, 480 ]
await updateConf(resolutions)
liveVideoId = await createLiveWrapper(false)
const command = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, liveVideoId)
- await waitUntilLivePublished(servers[0].url, servers[0].accessToken, liveVideoId)
+ await waitUntilLivePublishedOnAllServers(liveVideoId)
await waitJobs(servers)
await testVideoResolutions(liveVideoId, resolutions)
liveVideoId = await createLiveWrapper(true)
const command = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, liveVideoId, 'video_short2.webm')
- await waitUntilLivePublished(servers[0].url, servers[0].accessToken, liveVideoId)
+ await waitUntilLivePublishedOnAllServers(liveVideoId)
await waitJobs(servers)
await testVideoResolutions(liveVideoId, resolutions)
await waitJobs(servers)
- await waitUntilLivePublished(servers[0].url, servers[0].accessToken, liveVideoId)
+ await waitUntilLivePublishedOnAllServers(liveVideoId)
const bitrateLimits = {
720: 5000 * 1000, // 60FPS
liveVideoId = res.body.video.uuid
command = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, liveVideoId)
- await waitUntilLivePublished(servers[0].url, servers[0].accessToken, liveVideoId)
+ await waitUntilLivePublishedOnAllServers(liveVideoId)
await waitJobs(servers)
})
const command = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, liveVideoUUID)
- for (const server of servers) {
- await waitUntilLivePublished(server.url, server.accessToken, liveVideoUUID)
- }
-
+ await waitUntilLivePublishedOnAllServers(liveVideoUUID)
await waitJobs(servers)
for (const stateChanges of [ localStateChanges, remoteStateChanges ]) {
for (const server of servers) {
await waitUntilLiveEnded(server.url, server.accessToken, liveVideoUUID)
}
-
await waitJobs(servers)
for (const stateChanges of [ localStateChanges, remoteStateChanges ]) {
const command = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, liveVideoUUID)
- for (const server of servers) {
- await waitUntilLivePublished(server.url, server.accessToken, liveVideoUUID)
- }
-
+ await waitUntilLivePublishedOnAllServers(liveVideoUUID)
await waitJobs(servers)
expect(localLastVideoViews).to.equal(0)
socket.emit('subscribe', { videoId })
const command = await sendRTMPStreamInVideo(servers[0].url, servers[0].accessToken, liveVideoUUID)
- await waitUntilLivePublished(servers[0].url, servers[0].accessToken, liveVideoUUID)
+
+ await waitUntilLivePublishedOnAllServers(liveVideoUUID)
await waitJobs(servers)
expect(stateChanges).to.have.lengthOf(1)