diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-12-07 17:56:59 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-12-07 17:56:59 +0100 |
commit | c182778e26b8478fae9d7dd0bf0687baf7b72fd1 (patch) | |
tree | 1ab51871575ce7da97eb63346d62d2a52332d82e /client/src/app/videos/+video-edit/video-add.component.ts | |
parent | baeefe22caf8ae6cb58dc40754e5db14b50168bf (diff) | |
download | PeerTube-c182778e26b8478fae9d7dd0bf0687baf7b72fd1.tar.gz PeerTube-c182778e26b8478fae9d7dd0bf0687baf7b72fd1.tar.zst PeerTube-c182778e26b8478fae9d7dd0bf0687baf7b72fd1.zip |
Add progress bar for video upload
Diffstat (limited to 'client/src/app/videos/+video-edit/video-add.component.ts')
-rw-r--r-- | client/src/app/videos/+video-edit/video-add.component.ts | 8 |
1 files changed, 4 insertions, 4 deletions
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 c2ee4ae2e..2409acfda 100644 --- a/client/src/app/videos/+video-edit/video-add.component.ts +++ b/client/src/app/videos/+video-edit/video-add.component.ts | |||
@@ -24,7 +24,7 @@ export class VideoAddComponent extends FormReactive implements OnInit { | |||
24 | 24 | ||
25 | isUploadingVideo = false | 25 | isUploadingVideo = false |
26 | videoUploaded = false | 26 | videoUploaded = false |
27 | progressPercent = 0 | 27 | videoUploadPercents = 0 |
28 | 28 | ||
29 | error: string = null | 29 | error: string = null |
30 | form: FormGroup | 30 | form: FormGroup |
@@ -55,7 +55,7 @@ export class VideoAddComponent extends FormReactive implements OnInit { | |||
55 | ngOnInit () { | 55 | ngOnInit () { |
56 | this.buildForm() | 56 | this.buildForm() |
57 | 57 | ||
58 | this.serverService.videoCategoriesLoaded | 58 | this.serverService.videoPrivaciesLoaded |
59 | .subscribe( | 59 | .subscribe( |
60 | () => { | 60 | () => { |
61 | this.videoPrivacies = this.serverService.getVideoPrivacies() | 61 | this.videoPrivacies = this.serverService.getVideoPrivacies() |
@@ -112,7 +112,7 @@ export class VideoAddComponent extends FormReactive implements OnInit { | |||
112 | this.videoService.uploadVideo(formData).subscribe( | 112 | this.videoService.uploadVideo(formData).subscribe( |
113 | event => { | 113 | event => { |
114 | if (event.type === HttpEventType.UploadProgress) { | 114 | if (event.type === HttpEventType.UploadProgress) { |
115 | this.progressPercent = Math.round(100 * event.loaded / event.total) | 115 | this.videoUploadPercents = Math.round(100 * event.loaded / event.total) |
116 | } else if (event instanceof HttpResponse) { | 116 | } else if (event instanceof HttpResponse) { |
117 | console.log('Video uploaded.') | 117 | console.log('Video uploaded.') |
118 | 118 | ||
@@ -122,7 +122,7 @@ export class VideoAddComponent extends FormReactive implements OnInit { | |||
122 | 122 | ||
123 | err => { | 123 | err => { |
124 | // Reset progress | 124 | // Reset progress |
125 | this.progressPercent = 0 | 125 | this.videoUploadPercents = 0 |
126 | this.error = err.message | 126 | this.error = err.message |
127 | } | 127 | } |
128 | ) | 128 | ) |