Improve progress bar

pull/10/head
Chocobozzz 2016-03-16 21:22:21 +01:00
parent dd00473a6d
commit 86e054b20f
1 changed files with 4 additions and 1 deletions

View File

@ -36,10 +36,13 @@ export class VideosAddComponent implements OnInit {
progressall: (e, data) => { progressall: (e, data) => {
this.progressBar.value = data.loaded; this.progressBar.value = data.loaded;
this.progressBar.max = data.total; // The server is a little bit slow to answer (has to seed the video)
// So we add more time to the progress bar (+10%)
this.progressBar.max = data.total + (0.1 * data.total);
}, },
done: (e, data) => { done: (e, data) => {
this.progressBar.value = this.progressBar.max;
console.log('Video uploaded.'); console.log('Video uploaded.');
// Print all the videos once it's finished // Print all the videos once it's finished