diff options
Diffstat (limited to 'server/tests/api/live/live-socket-messages.ts')
-rw-r--r-- | server/tests/api/live/live-socket-messages.ts | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/server/tests/api/live/live-socket-messages.ts b/server/tests/api/live/live-socket-messages.ts index 1f3d455a8..ad67d6285 100644 --- a/server/tests/api/live/live-socket-messages.ts +++ b/server/tests/api/live/live-socket-messages.ts | |||
@@ -30,7 +30,7 @@ describe('Test live', function () { | |||
30 | await setAccessTokensToServers(servers) | 30 | await setAccessTokensToServers(servers) |
31 | await setDefaultVideoChannel(servers) | 31 | await setDefaultVideoChannel(servers) |
32 | 32 | ||
33 | await servers[0].configCommand.updateCustomSubConfig({ | 33 | await servers[0].config.updateCustomSubConfig({ |
34 | newConfig: { | 34 | newConfig: { |
35 | live: { | 35 | live: { |
36 | enabled: true, | 36 | enabled: true, |
@@ -51,11 +51,11 @@ describe('Test live', function () { | |||
51 | async function createLiveWrapper () { | 51 | async function createLiveWrapper () { |
52 | const liveAttributes = { | 52 | const liveAttributes = { |
53 | name: 'live video', | 53 | name: 'live video', |
54 | channelId: servers[0].videoChannel.id, | 54 | channelId: servers[0].store.channel.id, |
55 | privacy: VideoPrivacy.PUBLIC | 55 | privacy: VideoPrivacy.PUBLIC |
56 | } | 56 | } |
57 | 57 | ||
58 | const { uuid } = await servers[0].liveCommand.create({ fields: liveAttributes }) | 58 | const { uuid } = await servers[0].live.create({ fields: liveAttributes }) |
59 | return uuid | 59 | return uuid |
60 | } | 60 | } |
61 | 61 | ||
@@ -69,22 +69,22 @@ describe('Test live', function () { | |||
69 | await waitJobs(servers) | 69 | await waitJobs(servers) |
70 | 70 | ||
71 | { | 71 | { |
72 | const videoId = await servers[0].videosCommand.getId({ uuid: liveVideoUUID }) | 72 | const videoId = await servers[0].videos.getId({ uuid: liveVideoUUID }) |
73 | 73 | ||
74 | const localSocket = servers[0].socketIOCommand.getLiveNotificationSocket() | 74 | const localSocket = servers[0].socketIO.getLiveNotificationSocket() |
75 | localSocket.on('state-change', data => localStateChanges.push(data.state)) | 75 | localSocket.on('state-change', data => localStateChanges.push(data.state)) |
76 | localSocket.emit('subscribe', { videoId }) | 76 | localSocket.emit('subscribe', { videoId }) |
77 | } | 77 | } |
78 | 78 | ||
79 | { | 79 | { |
80 | const videoId = await servers[1].videosCommand.getId({ uuid: liveVideoUUID }) | 80 | const videoId = await servers[1].videos.getId({ uuid: liveVideoUUID }) |
81 | 81 | ||
82 | const remoteSocket = servers[1].socketIOCommand.getLiveNotificationSocket() | 82 | const remoteSocket = servers[1].socketIO.getLiveNotificationSocket() |
83 | remoteSocket.on('state-change', data => remoteStateChanges.push(data.state)) | 83 | remoteSocket.on('state-change', data => remoteStateChanges.push(data.state)) |
84 | remoteSocket.emit('subscribe', { videoId }) | 84 | remoteSocket.emit('subscribe', { videoId }) |
85 | } | 85 | } |
86 | 86 | ||
87 | const ffmpegCommand = await servers[0].liveCommand.sendRTMPStreamInVideo({ videoId: liveVideoUUID }) | 87 | const ffmpegCommand = await servers[0].live.sendRTMPStreamInVideo({ videoId: liveVideoUUID }) |
88 | 88 | ||
89 | await waitUntilLivePublishedOnAllServers(servers, liveVideoUUID) | 89 | await waitUntilLivePublishedOnAllServers(servers, liveVideoUUID) |
90 | await waitJobs(servers) | 90 | await waitJobs(servers) |
@@ -97,7 +97,7 @@ describe('Test live', function () { | |||
97 | await stopFfmpeg(ffmpegCommand) | 97 | await stopFfmpeg(ffmpegCommand) |
98 | 98 | ||
99 | for (const server of servers) { | 99 | for (const server of servers) { |
100 | await server.liveCommand.waitUntilEnded({ videoId: liveVideoUUID }) | 100 | await server.live.waitUntilEnded({ videoId: liveVideoUUID }) |
101 | } | 101 | } |
102 | await waitJobs(servers) | 102 | await waitJobs(servers) |
103 | 103 | ||
@@ -117,22 +117,22 @@ describe('Test live', function () { | |||
117 | await waitJobs(servers) | 117 | await waitJobs(servers) |
118 | 118 | ||
119 | { | 119 | { |
120 | const videoId = await servers[0].videosCommand.getId({ uuid: liveVideoUUID }) | 120 | const videoId = await servers[0].videos.getId({ uuid: liveVideoUUID }) |
121 | 121 | ||
122 | const localSocket = servers[0].socketIOCommand.getLiveNotificationSocket() | 122 | const localSocket = servers[0].socketIO.getLiveNotificationSocket() |
123 | localSocket.on('views-change', data => { localLastVideoViews = data.views }) | 123 | localSocket.on('views-change', data => { localLastVideoViews = data.views }) |
124 | localSocket.emit('subscribe', { videoId }) | 124 | localSocket.emit('subscribe', { videoId }) |
125 | } | 125 | } |
126 | 126 | ||
127 | { | 127 | { |
128 | const videoId = await servers[1].videosCommand.getId({ uuid: liveVideoUUID }) | 128 | const videoId = await servers[1].videos.getId({ uuid: liveVideoUUID }) |
129 | 129 | ||
130 | const remoteSocket = servers[1].socketIOCommand.getLiveNotificationSocket() | 130 | const remoteSocket = servers[1].socketIO.getLiveNotificationSocket() |
131 | remoteSocket.on('views-change', data => { remoteLastVideoViews = data.views }) | 131 | remoteSocket.on('views-change', data => { remoteLastVideoViews = data.views }) |
132 | remoteSocket.emit('subscribe', { videoId }) | 132 | remoteSocket.emit('subscribe', { videoId }) |
133 | } | 133 | } |
134 | 134 | ||
135 | const ffmpegCommand = await servers[0].liveCommand.sendRTMPStreamInVideo({ videoId: liveVideoUUID }) | 135 | const ffmpegCommand = await servers[0].live.sendRTMPStreamInVideo({ videoId: liveVideoUUID }) |
136 | 136 | ||
137 | await waitUntilLivePublishedOnAllServers(servers, liveVideoUUID) | 137 | await waitUntilLivePublishedOnAllServers(servers, liveVideoUUID) |
138 | await waitJobs(servers) | 138 | await waitJobs(servers) |
@@ -140,8 +140,8 @@ describe('Test live', function () { | |||
140 | expect(localLastVideoViews).to.equal(0) | 140 | expect(localLastVideoViews).to.equal(0) |
141 | expect(remoteLastVideoViews).to.equal(0) | 141 | expect(remoteLastVideoViews).to.equal(0) |
142 | 142 | ||
143 | await servers[0].videosCommand.view({ id: liveVideoUUID }) | 143 | await servers[0].videos.view({ id: liveVideoUUID }) |
144 | await servers[1].videosCommand.view({ id: liveVideoUUID }) | 144 | await servers[1].videos.view({ id: liveVideoUUID }) |
145 | 145 | ||
146 | await waitJobs(servers) | 146 | await waitJobs(servers) |
147 | await wait(5000) | 147 | await wait(5000) |
@@ -161,13 +161,13 @@ describe('Test live', function () { | |||
161 | const liveVideoUUID = await createLiveWrapper() | 161 | const liveVideoUUID = await createLiveWrapper() |
162 | await waitJobs(servers) | 162 | await waitJobs(servers) |
163 | 163 | ||
164 | const videoId = await servers[0].videosCommand.getId({ uuid: liveVideoUUID }) | 164 | const videoId = await servers[0].videos.getId({ uuid: liveVideoUUID }) |
165 | 165 | ||
166 | const socket = servers[0].socketIOCommand.getLiveNotificationSocket() | 166 | const socket = servers[0].socketIO.getLiveNotificationSocket() |
167 | socket.on('state-change', data => stateChanges.push(data.state)) | 167 | socket.on('state-change', data => stateChanges.push(data.state)) |
168 | socket.emit('subscribe', { videoId }) | 168 | socket.emit('subscribe', { videoId }) |
169 | 169 | ||
170 | const command = await servers[0].liveCommand.sendRTMPStreamInVideo({ videoId: liveVideoUUID }) | 170 | const command = await servers[0].live.sendRTMPStreamInVideo({ videoId: liveVideoUUID }) |
171 | 171 | ||
172 | await waitUntilLivePublishedOnAllServers(servers, liveVideoUUID) | 172 | await waitUntilLivePublishedOnAllServers(servers, liveVideoUUID) |
173 | await waitJobs(servers) | 173 | await waitJobs(servers) |