import 'mocha'
import * as chai from 'chai'
import { FfmpegCommand } from 'fluent-ffmpeg'
-import { VideoDetails, VideoPrivacy } from '@shared/models'
+import { VideoPrivacy } from '@shared/models'
import {
cleanupTests,
doubleFollow,
flushAndRunMultipleServers,
- getVideo,
ServerInfo,
setAccessTokensToServers,
setDefaultVideoChannel,
stopFfmpeg,
- viewVideo,
wait,
waitJobs,
waitUntilLivePublishedOnAllServers
async function countViews (expected: number) {
for (const server of servers) {
- const res = await getVideo(server.url, liveVideoId)
- const video: VideoDetails = res.body
-
+ const video = await server.videosCommand.get({ id: liveVideoId })
expect(video.views).to.equal(expected)
}
}
privacy: VideoPrivacy.PUBLIC
}
- const live = await servers[0].liveCommand.createLive({ fields: liveAttributes })
+ const live = await servers[0].liveCommand.create({ fields: liveAttributes })
liveVideoId = live.uuid
command = await servers[0].liveCommand.sendRTMPStreamInVideo({ videoId: liveVideoId })
it('Should view a live twice and display 1 view', async function () {
this.timeout(30000)
- await viewVideo(servers[0].url, liveVideoId)
- await viewVideo(servers[0].url, liveVideoId)
+ await servers[0].videosCommand.view({ id: liveVideoId })
+ await servers[0].videosCommand.view({ id: liveVideoId })
await wait(7000)
it('Should view a live on a remote and on local and display 2 views', async function () {
this.timeout(30000)
- await viewVideo(servers[0].url, liveVideoId)
- await viewVideo(servers[1].url, liveVideoId)
- await viewVideo(servers[1].url, liveVideoId)
+ await servers[0].videosCommand.view({ id: liveVideoId })
+ await servers[1].videosCommand.view({ id: liveVideoId })
+ await servers[1].videosCommand.view({ id: liveVideoId })
await wait(7000)
await waitJobs(servers)