using System; using MediaBrowser.Controller; namespace Emby.Server.Implementations.Browser { /// /// Class BrowserLauncher. /// public static class BrowserLauncher { /// /// Opens the web client. /// /// The app host. public static void OpenWebApp(IServerApplicationHost appHost) { var url = appHost.GetLocalApiUrl("localhost") + "/web/index.html"; OpenUrl(appHost, url); } /// /// Opens the swagger API page. /// /// The app host. public static void OpenSwaggerPage(IServerApplicationHost appHost) { var url = appHost.GetLocalApiUrl("localhost") + "/swagger/index.html"; OpenUrl(appHost, url); } /// /// Opens the URL. /// /// The application host instance. /// The URL. private static void OpenUrl(IServerApplicationHost appHost, string url) { try { appHost.LaunchUrl(url); } catch (NotSupportedException) { } catch (Exception) { } } } }