Click here to Skip to main content
15,889,096 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
Hi Guys,

I need your help with the Webbrowser element.
I made a program that plays youtube-links like a mediaplayer.
So you have serveral URLs that direct you to youtube and plays the video.
Since the last flashplayer update it doesn´t work anymore.
If you try for example to start this link:
C#
webBrowser1.Navigate("http://www.youtube.com/watch?v=-yh6SriAjdE&feature=g-logo&context=G2dea9c8FOAAAAAAABAA");

The video is loading but there is the play button in the middle.
But it should play the video without needing to be clicked.

Has anybody of you a solution...
Posted
Updated 22-Dec-11 21:36pm
v2
Comments
Sunasara Imdadhusen 23-Dec-11 4:33am    
Good question! my vote of 5
ProEnggSoft 8-Mar-12 19:31pm    
Good question! My 5

Hi
I think this may help you

ASP.NET Embedded Video Player (YouTube™ API, C#)[^]

Thanks,
Imdadhusen
 
Share this answer
 
Comments
Member 7983150 23-Dec-11 4:48am    
Hi
Nice player! Sure i could use it, but i would like to keep mine.

Thanks anyway!
Hi,

just add ?autoplay=1 behind your youtube url.

C#
webBrowser1.Navigate("http://www.youtube.com/embed/rdKFioMyieQ?autoplay=1");


With Best Regards,
Björn
 
Share this answer
 
v5
Comments
Member 7983150 6-Mar-12 1:09am    
Hi,
it doesn´t work either.
I´ve created 2 buttons, both of them have different URLs and your &autoplay=1.
If I click on the first button it works but if I click now the second button it doesn´t work anymore. Do I have to close or clear the webelement???

Best regards
Tom
El_Codero 8-Mar-12 12:32pm    
Hi Tom,
oh I've just had a look into the new youtube api and they changed a few tags and parameters because of HTML5-VideoPlayer.

Use this link: webBrowser1.Navigate("http://www.youtube.com/embed/rdKFioMyieQ?autoplay=1");

It works quite well in my enviroment. Best Regards
Member 7983150 12-Mar-12 2:21am    
Hi Björn,
sorry for answering only now.
It works but you have to modify the youtube link to your format.
You get a string like that:
http://www.youtube.com/watch?v=ykwAirfRulg&feature=g-logo&context=G20b913cFOAAAAAAAXAA
Now I need to filter the 'ykwAirfRulg' and put it into:
http://www.youtube.com/embed/ykwAirfRulg?autoplay=1

Now it works thank you very much!!!
Tom

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900