aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts')
-rw-r--r--client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts b/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts
index 8e2d0deaf..3fcb71ac3 100644
--- a/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts
+++ b/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts
@@ -14,6 +14,7 @@ import { VideoSend } from '@app/videos/+video-edit/video-add-components/video-se
14import { CanComponentDeactivate } from '@app/shared/guards/can-deactivate-guard.service' 14import { CanComponentDeactivate } from '@app/shared/guards/can-deactivate-guard.service'
15import { FormValidatorService, UserService } from '@app/shared' 15import { FormValidatorService, UserService } from '@app/shared'
16import { VideoCaptionService } from '@app/shared/video-caption' 16import { VideoCaptionService } from '@app/shared/video-caption'
17import { scrollToTop } from '@app/shared/misc/utils'
17 18
18@Component({ 19@Component({
19 selector: 'my-video-upload', 20 selector: 'my-video-upload',
@@ -25,6 +26,7 @@ import { VideoCaptionService } from '@app/shared/video-caption'
25}) 26})
26export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy, CanComponentDeactivate { 27export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy, CanComponentDeactivate {
27 @Output() firstStepDone = new EventEmitter<string>() 28 @Output() firstStepDone = new EventEmitter<string>()
29 @Output() firstStepError = new EventEmitter<void>()
28 @ViewChild('videofileInput') videofileInput: ElementRef<HTMLInputElement> 30 @ViewChild('videofileInput') videofileInput: ElementRef<HTMLInputElement>
29 31
30 // So that it can be accessed in the template 32 // So that it can be accessed in the template
@@ -43,6 +45,8 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy
43 uuid: '' 45 uuid: ''
44 } 46 }
45 47
48 error: string
49
46 protected readonly DEFAULT_VIDEO_PRIVACY = VideoPrivacy.PUBLIC 50 protected readonly DEFAULT_VIDEO_PRIVACY = VideoPrivacy.PUBLIC
47 51
48 constructor ( 52 constructor (
@@ -201,6 +205,7 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy
201 this.isUploadingVideo = false 205 this.isUploadingVideo = false
202 this.videoUploadPercents = 0 206 this.videoUploadPercents = 0
203 this.videoUploadObservable = null 207 this.videoUploadObservable = null
208 this.firstStepError.emit()
204 this.notificationsService.error(this.i18n('Error'), err.message) 209 this.notificationsService.error(this.i18n('Error'), err.message)
205 } 210 }
206 ) 211 )
@@ -235,8 +240,8 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy
235 }, 240 },
236 241
237 err => { 242 err => {
238 this.isUpdatingVideo = false 243 this.error = err.message
239 this.notificationsService.error(this.i18n('Error'), err.message) 244 scrollToTop()
240 console.error(err) 245 console.error(err)
241 } 246 }
242 ) 247 )