describe('When getting live information', function () {
it('Should fail without access token', async function () {
- await command.getLive({ token: '', videoId: video.id, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 })
+ await command.get({ token: '', videoId: video.id, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 })
})
it('Should fail with a bad access token', async function () {
- await command.getLive({ token: 'toto', videoId: video.id, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 })
+ await command.get({ token: 'toto', videoId: video.id, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 })
})
it('Should fail with access token of another user', async function () {
- await command.getLive({ token: userAccessToken, videoId: video.id, expectedStatus: HttpStatusCode.FORBIDDEN_403 })
+ await command.get({ token: userAccessToken, videoId: video.id, expectedStatus: HttpStatusCode.FORBIDDEN_403 })
})
it('Should fail with a bad video id', async function () {
- await command.getLive({ videoId: 'toto', expectedStatus: HttpStatusCode.BAD_REQUEST_400 })
+ await command.get({ videoId: 'toto', expectedStatus: HttpStatusCode.BAD_REQUEST_400 })
})
it('Should fail with an unknown video id', async function () {
- await command.getLive({ videoId: 454555, expectedStatus: HttpStatusCode.NOT_FOUND_404 })
+ await command.get({ videoId: 454555, expectedStatus: HttpStatusCode.NOT_FOUND_404 })
})
it('Should fail with a non live video', async function () {
- await command.getLive({ videoId: videoIdNotLive, expectedStatus: HttpStatusCode.NOT_FOUND_404 })
+ await command.get({ videoId: videoIdNotLive, expectedStatus: HttpStatusCode.NOT_FOUND_404 })
})
it('Should succeed with the correct params', async function () {
- await command.getLive({ videoId: video.id })
- await command.getLive({ videoId: video.uuid })
- await command.getLive({ videoId: video.shortUUID })
+ await command.get({ videoId: video.id })
+ await command.get({ videoId: video.uuid })
+ await command.get({ videoId: video.shortUUID })
})
})
describe('When updating live information', async function () {
it('Should fail without access token', async function () {
- await command.updateLive({ token: '', videoId: video.id, fields: {}, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 })
+ await command.update({ token: '', videoId: video.id, fields: {}, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 })
})
it('Should fail with a bad access token', async function () {
- await command.updateLive({ token: 'toto', videoId: video.id, fields: {}, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 })
+ await command.update({ token: 'toto', videoId: video.id, fields: {}, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 })
})
it('Should fail with access token of another user', async function () {
- await command.updateLive({ token: userAccessToken, videoId: video.id, fields: {}, expectedStatus: HttpStatusCode.FORBIDDEN_403 })
+ await command.update({ token: userAccessToken, videoId: video.id, fields: {}, expectedStatus: HttpStatusCode.FORBIDDEN_403 })
})
it('Should fail with a bad video id', async function () {
- await command.updateLive({ videoId: 'toto', fields: {}, expectedStatus: HttpStatusCode.BAD_REQUEST_400 })
+ await command.update({ videoId: 'toto', fields: {}, expectedStatus: HttpStatusCode.BAD_REQUEST_400 })
})
it('Should fail with an unknown video id', async function () {
- await command.updateLive({ videoId: 454555, fields: {}, expectedStatus: HttpStatusCode.NOT_FOUND_404 })
+ await command.update({ videoId: 454555, fields: {}, expectedStatus: HttpStatusCode.NOT_FOUND_404 })
})
it('Should fail with a non live video', async function () {
- await command.updateLive({ videoId: videoIdNotLive, fields: {}, expectedStatus: HttpStatusCode.NOT_FOUND_404 })
+ await command.update({ videoId: videoIdNotLive, fields: {}, expectedStatus: HttpStatusCode.NOT_FOUND_404 })
})
it('Should fail with save replay and permanent live set to true', async function () {
const fields = { saveReplay: true, permanentLive: true }
- await command.updateLive({ videoId: video.id, fields, expectedStatus: HttpStatusCode.BAD_REQUEST_400 })
+ await command.update({ videoId: video.id, fields, expectedStatus: HttpStatusCode.BAD_REQUEST_400 })
})
it('Should succeed with the correct params', async function () {
- await command.updateLive({ videoId: video.id, fields: { saveReplay: false } })
- await command.updateLive({ videoId: video.uuid, fields: { saveReplay: false } })
- await command.updateLive({ videoId: video.shortUUID, fields: { saveReplay: false } })
+ await command.update({ videoId: video.id, fields: { saveReplay: false } })
+ await command.update({ videoId: video.uuid, fields: { saveReplay: false } })
+ await command.update({ videoId: video.shortUUID, fields: { saveReplay: false } })
})
it('Should fail to update replay status if replay is not allowed on the instance', async function () {
}
})
- await command.updateLive({ videoId: video.id, fields: { saveReplay: true }, expectedStatus: HttpStatusCode.FORBIDDEN_403 })
+ await command.update({ videoId: video.id, fields: { saveReplay: true }, expectedStatus: HttpStatusCode.FORBIDDEN_403 })
})
it('Should fail to update a live if it has already started', async function () {
this.timeout(40000)
- const live = await command.getLive({ videoId: video.id })
+ const live = await command.get({ videoId: video.id })
const ffmpegCommand = sendRTMPStream(live.rtmpUrl, live.streamKey)
- await command.waitUntilLivePublished({ videoId: video.id })
- await command.updateLive({ videoId: video.id, fields: {}, expectedStatus: HttpStatusCode.BAD_REQUEST_400 })
+ await command.waitUntilPublished({ videoId: video.id })
+ await command.update({ videoId: video.id, fields: {}, expectedStatus: HttpStatusCode.BAD_REQUEST_400 })
await stopFfmpeg(ffmpegCommand)
})
it('Should fail to stream twice in the save live', async function () {
this.timeout(40000)
- const live = await command.getLive({ videoId: video.id })
+ const live = await command.get({ videoId: video.id })
const ffmpegCommand = sendRTMPStream(live.rtmpUrl, live.streamKey)
- await command.waitUntilLivePublished({ videoId: video.id })
+ await command.waitUntilPublished({ videoId: video.id })
- await command.runAndTestFfmpegStreamError({ videoId: video.id, shouldHaveError: true })
+ await command.runAndTestStreamError({ videoId: video.id, shouldHaveError: true })
await stopFfmpeg(ffmpegCommand)
})
saveReplay
}
- const { uuid } = await servers[0].liveCommand.createLive({ token: userAccessToken, fields: liveAttributes })
+ const { uuid } = await servers[0].liveCommand.create({ token: userAccessToken, fields: liveAttributes })
return uuid
}
async function waitUntilLivePublishedOnAllServers (videoId: string) {
for (const server of servers) {
- await server.liveCommand.waitUntilLivePublished({ videoId })
+ await server.liveCommand.waitUntilPublished({ videoId })
}
}
this.timeout(60000)
const userVideoLiveoId = await createLiveWrapper(false)
- await servers[0].liveCommand.runAndTestFfmpegStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: false })
+ await servers[0].liveCommand.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: false })
})
it('Should have size limit depending on user global quota if save replay is enabled', async function () {
await wait(5000)
const userVideoLiveoId = await createLiveWrapper(true)
- await servers[0].liveCommand.runAndTestFfmpegStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: true })
+ await servers[0].liveCommand.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: true })
await waitUntilLivePublishedOnAllServers(userVideoLiveoId)
await waitJobs(servers)
await updateQuota({ total: -1, daily: 1 })
const userVideoLiveoId = await createLiveWrapper(true)
- await servers[0].liveCommand.runAndTestFfmpegStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: true })
+ await servers[0].liveCommand.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: true })
await waitUntilLivePublishedOnAllServers(userVideoLiveoId)
await waitJobs(servers)
await updateQuota({ total: 10 * 1000 * 1000, daily: -1 })
const userVideoLiveoId = await createLiveWrapper(true)
- await servers[0].liveCommand.runAndTestFfmpegStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: false })
+ await servers[0].liveCommand.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: false })
})
it('Should have max duration limit', async function () {
})
const userVideoLiveoId = await createLiveWrapper(true)
- await servers[0].liveCommand.runAndTestFfmpegStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: true })
+ await servers[0].liveCommand.runAndTestStreamError({ token: userAccessToken, videoId: userVideoLiveoId, shouldHaveError: true })
await waitUntilLivePublishedOnAllServers(userVideoLiveoId)
await waitJobs(servers)
permanentLive
}
- const { uuid } = await servers[0].liveCommand.createLive({ fields: attributes })
+ const { uuid } = await servers[0].liveCommand.create({ fields: attributes })
return uuid
}
const videoUUID = await createLiveWrapper(false)
{
- const live = await servers[0].liveCommand.getLive({ videoId: videoUUID })
+ const live = await servers[0].liveCommand.get({ videoId: videoUUID })
expect(live.permanentLive).to.be.false
}
- await servers[0].liveCommand.updateLive({ videoId: videoUUID, fields: { permanentLive: true } })
+ await servers[0].liveCommand.update({ videoId: videoUUID, fields: { permanentLive: true } })
{
- const live = await servers[0].liveCommand.getLive({ videoId: videoUUID })
+ const live = await servers[0].liveCommand.get({ videoId: videoUUID })
expect(live.permanentLive).to.be.true
}
})
videoUUID = await createLiveWrapper(true)
- const live = await servers[0].liveCommand.getLive({ videoId: videoUUID })
+ const live = await servers[0].liveCommand.get({ videoId: videoUUID })
expect(live.permanentLive).to.be.true
await waitJobs(servers)
const ffmpegCommand = await servers[0].liveCommand.sendRTMPStreamInVideo({ videoId: videoUUID })
for (const server of servers) {
- await server.liveCommand.waitUntilLivePublished({ videoId: videoUUID })
+ await server.liveCommand.waitUntilPublished({ videoId: videoUUID })
}
await checkVideoState(videoUUID, VideoState.PUBLISHED)
await stopFfmpeg(ffmpegCommand)
- await servers[0].liveCommand.waitUntilLiveWaiting({ videoId: videoUUID })
+ await servers[0].liveCommand.waitUntilWaiting({ videoId: videoUUID })
await waitJobs(servers)
})
const ffmpegCommand = await servers[0].liveCommand.sendRTMPStreamInVideo({ videoId: videoUUID })
for (const server of servers) {
- await server.liveCommand.waitUntilLivePublished({ videoId: videoUUID })
+ await server.liveCommand.waitUntilPublished({ videoId: videoUUID })
}
await checkVideoState(videoUUID, VideoState.PUBLISHED)
- const count = await servers[0].liveCommand.getPlaylistsCount({ videoUUID })
+ const count = await servers[0].liveCommand.countPlaylists({ videoUUID })
// master playlist and 720p playlist
expect(count).to.equal(2)
saveReplay
}
- const { uuid } = await servers[0].liveCommand.createLive({ fields: attributes })
+ const { uuid } = await servers[0].liveCommand.create({ fields: attributes })
return uuid
}
async function waitUntilLivePublishedOnAllServers (videoId: string) {
for (const server of servers) {
- await server.liveCommand.waitUntilLivePublished({ videoId })
+ await server.liveCommand.waitUntilPublished({ videoId })
}
}
async function waitUntilLiveSavedOnAllServers (videoId: string) {
for (const server of servers) {
- await server.liveCommand.waitUntilLiveSaved({ videoId })
+ await server.liveCommand.waitUntilSaved({ videoId })
}
}
await stopFfmpeg(ffmpegCommand)
for (const server of servers) {
- await server.liveCommand.waitUntilLiveEnded({ videoId: liveVideoUUID })
+ await server.liveCommand.waitUntilEnded({ videoId: liveVideoUUID })
}
await waitJobs(servers)
privacy: VideoPrivacy.PUBLIC
}
- const { uuid } = await servers[0].liveCommand.createLive({ fields: liveAttributes })
+ const { uuid } = await servers[0].liveCommand.create({ fields: liveAttributes })
return uuid
}
await stopFfmpeg(ffmpegCommand)
for (const server of servers) {
- await server.liveCommand.waitUntilLiveEnded({ videoId: liveVideoUUID })
+ await server.liveCommand.waitUntilEnded({ videoId: liveVideoUUID })
}
await waitJobs(servers)
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 })
thumbnailfile: 'video_short1.webm.jpg'
}
- const live = await commands[0].createLive({ fields: attributes })
+ const live = await commands[0].create({ fields: attributes })
liveVideoUUID = live.uuid
await waitJobs(servers)
await testImage(server.url, 'video_short1-preview.webm', video.previewPath)
await testImage(server.url, 'video_short1.webm', video.thumbnailPath)
- const live = await server.liveCommand.getLive({ videoId: liveVideoUUID })
+ const live = await server.liveCommand.get({ videoId: liveVideoUUID })
if (server.url === servers[0].url) {
expect(live.rtmpUrl).to.equal('rtmp://' + server.hostname + ':' + servers[0].rtmpPort + '/live')
nsfw: true
}
- const live = await commands[0].createLive({ fields: attributes })
+ const live = await commands[0].create({ fields: attributes })
const videoId = live.uuid
await waitJobs(servers)
})
it('Should not be able to update a live of another server', async function () {
- await commands[1].updateLive({ videoId: liveVideoUUID, fields: { saveReplay: false }, expectedStatus: HttpStatusCode.FORBIDDEN_403 })
+ await commands[1].update({ videoId: liveVideoUUID, fields: { saveReplay: false }, expectedStatus: HttpStatusCode.FORBIDDEN_403 })
})
it('Should update the live', async function () {
this.timeout(10000)
- await commands[0].updateLive({ videoId: liveVideoUUID, fields: { saveReplay: false } })
+ await commands[0].update({ videoId: liveVideoUUID, fields: { saveReplay: false } })
await waitJobs(servers)
})
it('Have the live updated', async function () {
for (const server of servers) {
- const live = await server.liveCommand.getLive({ videoId: liveVideoUUID })
+ const live = await server.liveCommand.get({ videoId: liveVideoUUID })
if (server.url === servers[0].url) {
expect(live.rtmpUrl).to.equal('rtmp://' + server.hostname + ':' + servers[0].rtmpPort + '/live')
it('Should have the live deleted', async function () {
for (const server of servers) {
await getVideo(server.url, liveVideoUUID, HttpStatusCode.NOT_FOUND_404)
- await server.liveCommand.getLive({ videoId: liveVideoUUID, expectedStatus: HttpStatusCode.NOT_FOUND_404 })
+ await server.liveCommand.get({ videoId: liveVideoUUID, expectedStatus: HttpStatusCode.NOT_FOUND_404 })
}
})
})
vodVideoId = (await uploadVideoAndGetId({ server: servers[0], videoName: 'vod video' })).uuid
const liveOptions = { name: 'live', privacy: VideoPrivacy.PUBLIC, channelId: servers[0].videoChannel.id }
- const live = await commands[0].createLive({ fields: liveOptions })
+ const live = await commands[0].create({ fields: liveOptions })
liveVideoId = live.uuid
ffmpegCommand = await servers[0].liveCommand.sendRTMPStreamInVideo({ videoId: liveVideoId })
saveReplay: false
}
- const { uuid } = await commands[0].createLive({ fields: liveAttributes })
+ const { uuid } = await commands[0].create({ fields: liveAttributes })
- const live = await commands[0].getLive({ videoId: uuid })
+ const live = await commands[0].get({ videoId: uuid })
const resVideo = await getVideo(servers[0].url, uuid)
return Object.assign(resVideo.body as VideoDetails, live)
saveReplay
}
- const { uuid } = await commands[0].createLive({ fields: liveAttributes })
+ const { uuid } = await commands[0].create({ fields: liveAttributes })
return uuid
}
for (let i = 0; i < resolutions.length; i++) {
const segmentNum = 3
const segmentName = `${i}-00000${segmentNum}.ts`
- await commands[0].waitUntilLiveSegmentGeneration({ videoUUID: video.uuid, resolution: i, segment: segmentNum })
+ await commands[0].waitUntilSegmentGeneration({ videoUUID: video.uuid, resolution: i, segment: segmentNum })
const res = await getPlaylist(`${servers[0].url}/static/streaming-playlists/hls/${video.uuid}/${i}.m3u8`)
const subPlaylist = res.text
await testVideoResolutions(liveVideoId, resolutions)
await stopFfmpeg(ffmpegCommand)
- await commands[0].waitUntilLiveEnded({ videoId: liveVideoId })
+ await commands[0].waitUntilEnded({ videoId: liveVideoId })
await waitJobs(servers)
saveReplay
}
- const { uuid } = await commands[0].createLive({ fields: liveAttributes })
+ const { uuid } = await commands[0].create({ fields: liveAttributes })
return uuid
}
])
await Promise.all([
- commands[0].waitUntilLivePublished({ videoId: liveVideoId }),
- commands[0].waitUntilLivePublished({ videoId: liveVideoReplayId })
+ commands[0].waitUntilPublished({ videoId: liveVideoId }),
+ commands[0].waitUntilPublished({ videoId: liveVideoReplayId })
])
- await commands[0].waitUntilLiveSegmentGeneration({ videoUUID: liveVideoId, resolution: 0, segment: 2 })
- await commands[0].waitUntilLiveSegmentGeneration({ videoUUID: liveVideoReplayId, resolution: 0, segment: 2 })
+ await commands[0].waitUntilSegmentGeneration({ videoUUID: liveVideoId, resolution: 0, segment: 2 })
+ await commands[0].waitUntilSegmentGeneration({ videoUUID: liveVideoReplayId, resolution: 0, segment: 2 })
- await killallServers([ servers[0] ])
+ killallServers([ servers[0] ])
await reRunServer(servers[0])
await wait(5000)
it('Should cleanup lives', async function () {
this.timeout(60000)
- await commands[0].waitUntilLiveEnded({ videoId: liveVideoId })
+ await commands[0].waitUntilEnded({ videoId: liveVideoId })
})
it('Should save a live replay', async function () {
this.timeout(120000)
- await commands[0].waitUntilLivePublished({ videoId: liveVideoReplayId })
+ await commands[0].waitUntilPublished({ videoId: liveVideoReplayId })
})
})
const liveCommand = server.liveCommand
const liveAttributes = { name: 'live', privacy: VideoPrivacy.PUBLIC, channelId: server.videoChannel.id }
- const live = await liveCommand.createLive({ fields: liveAttributes })
+ const live = await liveCommand.create({ fields: liveAttributes })
const ffmpegCommand = await liveCommand.sendRTMPStreamInVideo({ videoId: live.id })
- await liveCommand.waitUntilLivePublished({ videoId: live.id })
+ await liveCommand.waitUntilPublished({ videoId: live.id })
const body = await command.advancedVideoSearch({ search: { isLive: true } })
{
const attributes = { name: 'live', channelId: firstUserChannelId, privacy: VideoPrivacy.PUBLIC }
- const video = await servers[0].liveCommand.createLive({ token: firstUserAccessToken, fields: attributes })
+ const video = await servers[0].liveCommand.create({ token: firstUserAccessToken, fields: attributes })
liveId = video.id
}
channelId: servers[0].videoChannel.id
}
- await servers[0].liveCommand.createLive({ fields: attributes })
+ await servers[0].liveCommand.create({ fields: attributes })
await checkHook('action:api.live-video.created')
})
channelId: servers[0].videoChannel.id
}
- await servers[0].liveCommand.createLive({ fields: attributes, expectedStatus: HttpStatusCode.FORBIDDEN_403 })
+ await servers[0].liveCommand.create({ fields: attributes, expectedStatus: HttpStatusCode.FORBIDDEN_403 })
})
it('Should run filter:api.video.pre-import-url.accept.result', async function () {
privacy: VideoPrivacy.PUBLIC
}
- const { uuid } = await server.liveCommand.createLive({ fields: liveAttributes })
+ const { uuid } = await server.liveCommand.create({ fields: liveAttributes })
return uuid
}
const liveVideoId = await createLiveWrapper(server)
await server.liveCommand.sendRTMPStreamInVideo({ videoId: liveVideoId, fixtureName: 'video_short2.webm' })
- await server.liveCommand.waitUntilLivePublished({ videoId: liveVideoId })
+ await server.liveCommand.waitUntilPublished({ videoId: liveVideoId })
await waitJobs([ server ])
await checkLiveFPS(liveVideoId, 'above', 20)
const liveVideoId = await createLiveWrapper(server)
await server.liveCommand.sendRTMPStreamInVideo({ videoId: liveVideoId, fixtureName: 'video_short2.webm' })
- await server.liveCommand.waitUntilLivePublished({ videoId: liveVideoId })
+ await server.liveCommand.waitUntilPublished({ videoId: liveVideoId })
await waitJobs([ server ])
await checkLiveFPS(liveVideoId, 'below', 12)
const liveVideoId = await createLiveWrapper(server)
await server.liveCommand.sendRTMPStreamInVideo({ videoId: liveVideoId, fixtureName: 'video_short2.webm' })
- await server.liveCommand.waitUntilLivePublished({ videoId: liveVideoId })
+ await server.liveCommand.waitUntilPublished({ videoId: liveVideoId })
await waitJobs([ server ])
await checkLiveFPS(liveVideoId, 'below', 6)
const liveVideoId = await createLiveWrapper(server)
await server.liveCommand.sendRTMPStreamInVideo({ videoId: liveVideoId, fixtureName: 'video_short2.webm' })
- await server.liveCommand.waitUntilLivePublished({ videoId: liveVideoId })
+ await server.liveCommand.waitUntilPublished({ videoId: liveVideoId })
await waitJobs([ server ])
const playlistUrl = `${server.url}/static/streaming-playlists/hls/${liveVideoId}/0.m3u8`
export class LiveCommand extends AbstractCommand {
- getLive (options: OverrideCommandOptions & {
+ get (options: OverrideCommandOptions & {
videoId: number | string
}) {
const path = '/api/v1/videos/live'
})
}
- updateLive (options: OverrideCommandOptions & {
+ update (options: OverrideCommandOptions & {
videoId: number | string
fields: LiveVideoUpdate
}) {
})
}
- async createLive (options: OverrideCommandOptions & {
+ async create (options: OverrideCommandOptions & {
fields: LiveVideoCreate
}) {
const { fields } = options
fixtureName?: string
}) {
const { videoId, fixtureName } = options
- const videoLive = await this.getLive({ videoId })
+ const videoLive = await this.get({ videoId })
return sendRTMPStream(videoLive.rtmpUrl, videoLive.streamKey, fixtureName)
}
- async runAndTestFfmpegStreamError (options: OverrideCommandOptions & {
+ async runAndTestStreamError (options: OverrideCommandOptions & {
videoId: number | string
shouldHaveError: boolean
}) {
return testFfmpegStreamError(command, options.shouldHaveError)
}
- waitUntilLivePublished (options: OverrideCommandOptions & {
+ waitUntilPublished (options: OverrideCommandOptions & {
videoId: number | string
}) {
const { videoId } = options
- return this.waitUntilLiveState({ videoId, state: VideoState.PUBLISHED })
+ return this.waitUntilState({ videoId, state: VideoState.PUBLISHED })
}
- waitUntilLiveWaiting (options: OverrideCommandOptions & {
+ waitUntilWaiting (options: OverrideCommandOptions & {
videoId: number | string
}) {
const { videoId } = options
- return this.waitUntilLiveState({ videoId, state: VideoState.WAITING_FOR_LIVE })
+ return this.waitUntilState({ videoId, state: VideoState.WAITING_FOR_LIVE })
}
- waitUntilLiveEnded (options: OverrideCommandOptions & {
+ waitUntilEnded (options: OverrideCommandOptions & {
videoId: number | string
}) {
const { videoId } = options
- return this.waitUntilLiveState({ videoId, state: VideoState.LIVE_ENDED })
+ return this.waitUntilState({ videoId, state: VideoState.LIVE_ENDED })
}
- waitUntilLiveSegmentGeneration (options: OverrideCommandOptions & {
+ waitUntilSegmentGeneration (options: OverrideCommandOptions & {
videoUUID: string
resolution: number
segment: number
return waitUntilLog(this.server, `${videoUUID}/${segmentName}`, 2, false)
}
- async waitUntilLiveSaved (options: OverrideCommandOptions & {
+ async waitUntilSaved (options: OverrideCommandOptions & {
videoId: number | string
}) {
let video: VideoDetails
} while (video.isLive === true && video.state.id !== VideoState.PUBLISHED)
}
- async getPlaylistsCount (options: OverrideCommandOptions & {
+ async countPlaylists (options: OverrideCommandOptions & {
videoUUID: string
}) {
const basePath = buildServerDirectory(this.server, 'streaming-playlists')
return files.filter(f => f.endsWith('.m3u8')).length
}
- private async waitUntilLiveState (options: OverrideCommandOptions & {
+ private async waitUntilState (options: OverrideCommandOptions & {
videoId: number | string
state: VideoState
}) {
async function waitUntilLivePublishedOnAllServers (servers: ServerInfo[], videoId: string) {
for (const server of servers) {
- await server.liveCommand.waitUntilLivePublished({ videoId })
+ await server.liveCommand.waitUntilPublished({ videoId })
}
}