Open YouTube Embedded Player link in default browser

810 views Asked by At

I'm hosting YouTube Embedded Player in C# WebBrowser control. When I click button "Watch on YouTube" IE opens. Is there any way to open the link in default web browser, for instance, Chrome?

1

There are 1 answers

2
SomeoneS On

Like this for example:

 private void browser_Navigating(object sender, WebBrowserNavigatingEventArgs e)
 {
 System.Diagnostics.Process.Start(e.Url.ToString());
 e.Cancel = true;
 }

Explanation: change the navigating handler to process the URL and fire the link in the diagnostics (which will open the URL in the user’s default browser).