diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-12 20:04:58 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-12 20:37:51 +0200 |
commit | 2186386cca113506791583cb07d6ccacba7af4e0 (patch) | |
tree | 3c214c0b5fbd64332624267fa6e51fd4a9cf6474 /client/src/app/videos/+video-edit | |
parent | 6ccdf3a23ecec5ba2eeaf487fd1fafdc7606b4bf (diff) | |
download | PeerTube-2186386cca113506791583cb07d6ccacba7af4e0.tar.gz PeerTube-2186386cca113506791583cb07d6ccacba7af4e0.tar.zst PeerTube-2186386cca113506791583cb07d6ccacba7af4e0.zip |
Add concept of video state, and add ability to wait transcoding before
publishing a video
Diffstat (limited to 'client/src/app/videos/+video-edit')
3 files changed, 17 insertions, 3 deletions
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 @@ | |||
109 | <label i18n for="commentsEnabled">Enable video comments</label> | 109 | <label i18n for="commentsEnabled">Enable video comments</label> |
110 | </div> | 110 | </div> |
111 | 111 | ||
112 | <div class="form-group form-group-checkbox"> | ||
113 | <input type="checkbox" id="waitTranscoding" formControlName="waitTranscoding" /> | ||
114 | <label for="waitTranscoding"></label> | ||
115 | <label i18n for="waitTranscoding">Wait transcoding before publishing the video</label> | ||
116 | <my-help | ||
117 | tooltipPlacement="top" helpType="custom" i18n-customHtml | ||
118 | customHtml="If you decide to not wait transcoding before publishing the video, it can be unplayable until it transcoding ends." | ||
119 | ></my-help> | ||
120 | </div> | ||
121 | |||
112 | </div> | 122 | </div> |
113 | </tab> | 123 | </tab> |
114 | 124 | ||
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 { | |||
47 | const defaultValues = { | 47 | const defaultValues = { |
48 | nsfw: 'false', | 48 | nsfw: 'false', |
49 | commentsEnabled: 'true', | 49 | commentsEnabled: 'true', |
50 | waitTranscoding: 'true', | ||
50 | tags: [] | 51 | tags: [] |
51 | } | 52 | } |
52 | const obj = { | 53 | const obj = { |
@@ -55,6 +56,7 @@ export class VideoEditComponent implements OnInit { | |||
55 | channelId: this.videoValidatorsService.VIDEO_CHANNEL, | 56 | channelId: this.videoValidatorsService.VIDEO_CHANNEL, |
56 | nsfw: null, | 57 | nsfw: null, |
57 | commentsEnabled: null, | 58 | commentsEnabled: null, |
59 | waitTranscoding: null, | ||
58 | category: this.videoValidatorsService.VIDEO_CATEGORY, | 60 | category: this.videoValidatorsService.VIDEO_CATEGORY, |
59 | licence: this.videoValidatorsService.VIDEO_LICENCE, | 61 | licence: this.videoValidatorsService.VIDEO_LICENCE, |
60 | language: this.videoValidatorsService.VIDEO_LANGUAGE, | 62 | language: this.videoValidatorsService.VIDEO_LANGUAGE, |
@@ -74,13 +76,13 @@ export class VideoEditComponent implements OnInit { | |||
74 | ) | 76 | ) |
75 | 77 | ||
76 | // We will update the "support" field depending on the channel | 78 | // We will update the "support" field depending on the channel |
77 | this.form.controls['channelId'] | 79 | this.form.controls[ 'channelId' ] |
78 | .valueChanges | 80 | .valueChanges |
79 | .pipe(map(res => parseInt(res.toString(), 10))) | 81 | .pipe(map(res => parseInt(res.toString(), 10))) |
80 | .subscribe( | 82 | .subscribe( |
81 | newChannelId => { | 83 | newChannelId => { |
82 | const oldChannelId = parseInt(this.form.value['channelId'], 10) | 84 | const oldChannelId = parseInt(this.form.value[ 'channelId' ], 10) |
83 | const currentSupport = this.form.value['support'] | 85 | const currentSupport = this.form.value[ 'support' ] |
84 | 86 | ||
85 | // Not initialized yet | 87 | // Not initialized yet |
86 | if (isNaN(newChannelId)) return | 88 | 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 | |||
164 | 164 | ||
165 | const privacy = this.firstStepPrivacyId.toString() | 165 | const privacy = this.firstStepPrivacyId.toString() |
166 | const nsfw = false | 166 | const nsfw = false |
167 | const waitTranscoding = true | ||
167 | const commentsEnabled = true | 168 | const commentsEnabled = true |
168 | const channelId = this.firstStepChannelId.toString() | 169 | const channelId = this.firstStepChannelId.toString() |
169 | 170 | ||
@@ -173,6 +174,7 @@ export class VideoAddComponent extends FormReactive implements OnInit, OnDestroy | |||
173 | formData.append('privacy', VideoPrivacy.PRIVATE.toString()) | 174 | formData.append('privacy', VideoPrivacy.PRIVATE.toString()) |
174 | formData.append('nsfw', '' + nsfw) | 175 | formData.append('nsfw', '' + nsfw) |
175 | formData.append('commentsEnabled', '' + commentsEnabled) | 176 | formData.append('commentsEnabled', '' + commentsEnabled) |
177 | formData.append('waitTranscoding', '' + waitTranscoding) | ||
176 | formData.append('channelId', '' + channelId) | 178 | formData.append('channelId', '' + channelId) |
177 | formData.append('videofile', videofile) | 179 | formData.append('videofile', videofile) |
178 | 180 | ||