From 2186386cca113506791583cb07d6ccacba7af4e0 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 12 Jun 2018 20:04:58 +0200 Subject: Add concept of video state, and add ability to wait transcoding before publishing a video --- .../app/videos/+video-edit/shared/video-edit.component.html | 10 ++++++++++ .../src/app/videos/+video-edit/shared/video-edit.component.ts | 8 +++++--- client/src/app/videos/+video-edit/video-add.component.ts | 2 ++ 3 files changed, 17 insertions(+), 3 deletions(-) (limited to 'client/src/app/videos/+video-edit') diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.html b/client/src/app/videos/+video-edit/shared/video-edit.component.html index c8cd0d679..379cf7948 100644 --- a/client/src/app/videos/+video-edit/shared/video-edit.component.html +++ b/client/src/app/videos/+video-edit/shared/video-edit.component.html @@ -109,6 +109,16 @@ +
+ + + + +
+ diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.ts b/client/src/app/videos/+video-edit/shared/video-edit.component.ts index 61515c0b0..ee4fd5dc1 100644 --- a/client/src/app/videos/+video-edit/shared/video-edit.component.ts +++ b/client/src/app/videos/+video-edit/shared/video-edit.component.ts @@ -47,6 +47,7 @@ export class VideoEditComponent implements OnInit { const defaultValues = { nsfw: 'false', commentsEnabled: 'true', + waitTranscoding: 'true', tags: [] } const obj = { @@ -55,6 +56,7 @@ export class VideoEditComponent implements OnInit { channelId: this.videoValidatorsService.VIDEO_CHANNEL, nsfw: null, commentsEnabled: null, + waitTranscoding: null, category: this.videoValidatorsService.VIDEO_CATEGORY, licence: this.videoValidatorsService.VIDEO_LICENCE, language: this.videoValidatorsService.VIDEO_LANGUAGE, @@ -74,13 +76,13 @@ export class VideoEditComponent implements OnInit { ) // We will update the "support" field depending on the channel - this.form.controls['channelId'] + this.form.controls[ 'channelId' ] .valueChanges .pipe(map(res => parseInt(res.toString(), 10))) .subscribe( newChannelId => { - const oldChannelId = parseInt(this.form.value['channelId'], 10) - const currentSupport = this.form.value['support'] + const oldChannelId = parseInt(this.form.value[ 'channelId' ], 10) + const currentSupport = this.form.value[ 'support' ] // Not initialized yet if (isNaN(newChannelId)) return diff --git a/client/src/app/videos/+video-edit/video-add.component.ts b/client/src/app/videos/+video-edit/video-add.component.ts index 332f757d7..85afd0caa 100644 --- a/client/src/app/videos/+video-edit/video-add.component.ts +++ b/client/src/app/videos/+video-edit/video-add.component.ts @@ -164,6 +164,7 @@ export class VideoAddComponent extends FormReactive implements OnInit, OnDestroy const privacy = this.firstStepPrivacyId.toString() const nsfw = false + const waitTranscoding = true const commentsEnabled = true const channelId = this.firstStepChannelId.toString() @@ -173,6 +174,7 @@ export class VideoAddComponent extends FormReactive implements OnInit, OnDestroy formData.append('privacy', VideoPrivacy.PRIVATE.toString()) formData.append('nsfw', '' + nsfw) formData.append('commentsEnabled', '' + commentsEnabled) + formData.append('waitTranscoding', '' + waitTranscoding) formData.append('channelId', '' + channelId) formData.append('videofile', videofile) -- cgit v1.2.3