I tried it in Console App first and it worked perfectly so I started to do it again on Windows Form App and it turned out not working at all. When the method like GetVideoAsync() or GetVideoMediaStreamInfosAsync() run, the whole thing is not running, I tried to create a thread just for it the program is stopped immediately.
Anyone know the solution?
Can you post code that replicates it?
You are probably deadlocking the UI. Remove T.Wait();.
Or replace this line var video = await client.GetVideoAsync(id); with var video = await client.GetVideoAsync(id).ConfigureAwait(false);
I accidentally removed my comment.
Here is link to the photo of the code : https://ibb.co/koy3g6
Oh wow! Both solutions work very well, but I have a question, if I remove T.Wait();, will the code below it run before the asynchrous method complete?
Yeah it will. The second solution is better in this case. The mistake you were making is waiting on the same thread as the one that was executing, so you entered a deadlock.
I did the same thing on Console App and it worked, that's why I did it in Windows Form App, but anyway, Thank you.
You're welcome!
And one more thing beside this problem, why doesn't the Muxed have 1080p?
Well that's just how it is, they are deprecated and YouTube doesn't use them AFAIK, so they are restricted in quality.
I tried to put the video that only has 144p resolution but there're two 360p and also 240p, can you explain that?
Nope, but if it works -- enjoy ;)
Actually, one of the 360ps is probably misidentified. Can you give video ID?
Here is the video ID : qo8iYgVmKl8
Nope, they're not misidentified, that's just how it is.
Okay, I'm just asking because there is no 360p. Like in this photo https://ibb.co/jyQVuR
Thank you for replying :) It's 4 AM in my country now, I should get some sleep.
You'd have to ask YouTube that question :p