aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/app/videos/video-add/video-add.component.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-05-27 17:49:18 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-05-27 17:49:18 +0200
commit4fd8aa327004b27530fd96bdde5df60e6745a1f6 (patch)
treee3b21282c641d50ea62e227c6ce3e7e740fec860 /client/app/videos/video-add/video-add.component.ts
parentccf6ed16f1eeb05b77103bd44bc06ccbbbba9bdd (diff)
downloadPeerTube-4fd8aa327004b27530fd96bdde5df60e6745a1f6.tar.gz
PeerTube-4fd8aa327004b27530fd96bdde5df60e6745a1f6.tar.zst
PeerTube-4fd8aa327004b27530fd96bdde5df60e6745a1f6.zip
Alphabetical
Diffstat (limited to 'client/app/videos/video-add/video-add.component.ts')
-rw-r--r--client/app/videos/video-add/video-add.component.ts21
1 files changed, 11 insertions, 10 deletions
diff --git a/client/app/videos/video-add/video-add.component.ts b/client/app/videos/video-add/video-add.component.ts
index 67a04a2b4..b11475ae9 100644
--- a/client/app/videos/video-add/video-add.component.ts
+++ b/client/app/videos/video-add/video-add.component.ts
@@ -18,20 +18,21 @@ declare var jQuery: any;
18}) 18})
19 19
20export class VideoAddComponent implements OnInit { 20export class VideoAddComponent implements OnInit {
21 user: User;
22 fileToUpload: any; 21 fileToUpload: any;
23 progressBar: { value: number; max: number; } = { value: 0, max: 0 }; 22 progressBar: { value: number; max: number; } = { value: 0, max: 0 };
23 user: User;
24 24
25 private _form: any; 25 private form: any;
26 26
27 constructor( 27 constructor(
28 private _router: Router, private _elementRef: ElementRef, 28 private router: Router,
29 private _authService: AuthService 29 private elementRef: ElementRef,
30 private authService: AuthService
30 ) {} 31 ) {}
31 32
32 ngOnInit() { 33 ngOnInit() {
33 this.user = User.load(); 34 this.user = User.load();
34 jQuery(this._elementRef.nativeElement).find('#videofile').fileupload({ 35 jQuery(this.elementRef.nativeElement).find('#videofile').fileupload({
35 url: '/api/v1/videos', 36 url: '/api/v1/videos',
36 dataType: 'json', 37 dataType: 'json',
37 singleFileUploads: true, 38 singleFileUploads: true,
@@ -39,7 +40,7 @@ export class VideoAddComponent implements OnInit {
39 autoupload: false, 40 autoupload: false,
40 41
41 add: (e, data) => { 42 add: (e, data) => {
42 this._form = data; 43 this.form = data;
43 this.fileToUpload = data['files'][0]; 44 this.fileToUpload = data['files'][0];
44 }, 45 },
45 46
@@ -55,14 +56,14 @@ export class VideoAddComponent implements OnInit {
55 console.log('Video uploaded.'); 56 console.log('Video uploaded.');
56 57
57 // Print all the videos once it's finished 58 // Print all the videos once it's finished
58 this._router.navigate(['VideosList']); 59 this.router.navigate(['VideosList']);
59 } 60 }
60 }); 61 });
61 } 62 }
62 63
63 uploadFile() { 64 uploadFile() {
64 this._form.headers = this._authService.getRequestHeader().toJSON(); 65 this.form.headers = this.authService.getRequestHeader().toJSON();
65 this._form.formData = jQuery(this._elementRef.nativeElement).find('form').serializeArray(); 66 this.form.formData = jQuery(this.elementRef.nativeElement).find('form').serializeArray();
66 this._form.submit(); 67 this.form.submit();
67 } 68 }
68} 69}