Play youtube video in windows form
Solution 1
Look here add youtube to winform. Just use their example. I hope this help.
Solution 2
- Add a
WebBrowser
control to your form - Retrieve the
embed
code of your video - Load the video into the
WebBrowser
Example :
const string page = "<html><head><title></title></head><body>{0}</body></html>";
webBrowser1.DocumentText = string.Format(page, "<iframe width=\"560\" height=\"315\" src=\"http://www.youtube.com/embed/yg2u_De8j5o\" frameborder=\"0\" allowfullscreen></iframe>");
As for counting the views : each time a user click the "View" button, load the video then increment your counter (this one should be easy enough).
Arnk
Updated on June 04, 2022Comments
-
Arnk about 2 years
I'm new to dot net and have a task to complete. I don't know how to start.
My Question: There should be a youtube video on my windows form. As a user clicks the play button that form should get refreshed and prints "1 person viewed" with the video playing. similarly user can repeat the process: he can again hit the play button and it will get refreshed. Now this time you will again see the video along with the text "2 person viewed". Basically, it's maintaining a counter of hitting the play button.
I'm unable to find anything regarding this on Google. I don't know how I will embed that video into the form.
-
Arnk almost 12 yearsim not maintaining any db plus how to use browser controls ?? please give me some tutorial if you find something relevant
-
Arnk almost 12 yearsThanks a lot :) it really helped
-
Arnk almost 12 yearsi have to count number of times the play button is pressed
-
Axiumin_ over 6 yearsThat won't work anymore as it got discontinued :\