From c6c0fa6cd8fe8f752463d8982c3dbcd448739c4e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 17 Sep 2020 09:20:52 +0200 Subject: Live streaming implementation first step --- server/tests/api/check-params/config.ts | 16 +++++++++++++ server/tests/api/server/config.ts | 36 +++++++++++++++++++++++++++++ server/tests/api/videos/video-transcoder.ts | 2 +- 3 files changed, 53 insertions(+), 1 deletion(-) (limited to 'server/tests') diff --git a/server/tests/api/check-params/config.ts b/server/tests/api/check-params/config.ts index 3f2708f94..35cb333ef 100644 --- a/server/tests/api/check-params/config.ts +++ b/server/tests/api/check-params/config.ts @@ -100,6 +100,22 @@ describe('Test config API validators', function () { enabled: false } }, + live: { + enabled: true, + + transcoding: { + enabled: true, + threads: 4, + resolutions: { + '240p': true, + '360p': true, + '480p': true, + '720p': true, + '1080p': true, + '2160p': true + } + } + }, import: { videos: { http: { diff --git a/server/tests/api/server/config.ts b/server/tests/api/server/config.ts index 60efd332c..a46e179c2 100644 --- a/server/tests/api/server/config.ts +++ b/server/tests/api/server/config.ts @@ -64,6 +64,7 @@ function checkInitialConfig (server: ServerInfo, data: CustomConfig) { expect(data.user.videoQuota).to.equal(5242880) expect(data.user.videoQuotaDaily).to.equal(-1) + expect(data.transcoding.enabled).to.be.false expect(data.transcoding.allowAdditionalExtensions).to.be.false expect(data.transcoding.allowAudioFiles).to.be.false @@ -77,6 +78,16 @@ function checkInitialConfig (server: ServerInfo, data: CustomConfig) { expect(data.transcoding.webtorrent.enabled).to.be.true expect(data.transcoding.hls.enabled).to.be.true + expect(data.live.enabled).to.be.false + expect(data.live.transcoding.enabled).to.be.false + expect(data.live.transcoding.threads).to.equal(2) + expect(data.live.transcoding.resolutions['240p']).to.be.false + expect(data.live.transcoding.resolutions['360p']).to.be.false + expect(data.live.transcoding.resolutions['480p']).to.be.false + expect(data.live.transcoding.resolutions['720p']).to.be.false + expect(data.live.transcoding.resolutions['1080p']).to.be.false + expect(data.live.transcoding.resolutions['2160p']).to.be.false + expect(data.import.videos.http.enabled).to.be.true expect(data.import.videos.torrent.enabled).to.be.true expect(data.autoBlacklist.videos.ofUsers.enabled).to.be.false @@ -150,6 +161,16 @@ function checkUpdatedConfig (data: CustomConfig) { expect(data.transcoding.hls.enabled).to.be.false expect(data.transcoding.webtorrent.enabled).to.be.true + expect(data.live.enabled).to.be.true + expect(data.live.transcoding.enabled).to.be.true + expect(data.live.transcoding.threads).to.equal(4) + expect(data.live.transcoding.resolutions['240p']).to.be.true + expect(data.live.transcoding.resolutions['360p']).to.be.true + expect(data.live.transcoding.resolutions['480p']).to.be.true + expect(data.live.transcoding.resolutions['720p']).to.be.true + expect(data.live.transcoding.resolutions['1080p']).to.be.true + expect(data.live.transcoding.resolutions['2160p']).to.be.true + expect(data.import.videos.http.enabled).to.be.false expect(data.import.videos.torrent.enabled).to.be.false expect(data.autoBlacklist.videos.ofUsers.enabled).to.be.true @@ -301,6 +322,21 @@ describe('Test config', function () { enabled: false } }, + live: { + enabled: true, + transcoding: { + enabled: true, + threads: 4, + resolutions: { + '240p': true, + '360p': true, + '480p': true, + '720p': true, + '1080p': true, + '2160p': true + } + } + }, import: { videos: { http: { diff --git a/server/tests/api/videos/video-transcoder.ts b/server/tests/api/videos/video-transcoder.ts index e3fd0ec22..a1959e1a9 100644 --- a/server/tests/api/videos/video-transcoder.ts +++ b/server/tests/api/videos/video-transcoder.ts @@ -83,7 +83,7 @@ describe('Test video transcoding', function () { }) it('Should transcode video on server 2', async function () { - this.timeout(60000) + this.timeout(120000) const videoAttributes = { name: 'my super name for server 2', -- cgit v1.2.3