0

I am trying to download a video from youtube using libvideo and update a progress bar accordingly. I don't really know how to use its async method. Can someone provide me with an example?

var youTube = YouTube.Default;
var video = await youTube.GetVideoAsync(Url);
netchkin
  • 1,387
  • 1
  • 12
  • 21
  • I think that you need to handle the progress bar stuff yourself. async/await in C# allows you not to block with I/O calls, but does not give you progress bars for free. You'll need to check for progress manually in a separate Task. – netchkin Oct 31 '16 at 11:05
  • That is my problem, i have no ideia how to do that! – Francisco Leal Oct 31 '16 at 12:29

1 Answers1

2

If you take a look at the project issues, you'll find that the library itself does not support getting progress. https://github.com/jamesqo/libvideo/issues/47

If you want to code the progress bar yourself, I suggest helping with the issue of the aforementioned github project.

Other approach could build on top of this answer: Progress bar with HttpClient libvideo uses HttpClient class on background.

Community
  • 1
  • 1
netchkin
  • 1,387
  • 1
  • 12
  • 21