2019-01-13 20:54:44 +01:00
|
|
|
using System;
|
2019-01-13 20:20:16 +01:00
|
|
|
using MediaBrowser.Controller;
|
2013-09-25 02:54:51 +02:00
|
|
|
|
2016-11-19 06:52:49 +01:00
|
|
|
namespace Emby.Server.Implementations.Browser
|
2013-09-25 02:54:51 +02:00
|
|
|
{
|
2013-09-27 19:04:35 +02:00
|
|
|
/// <summary>
|
2019-11-01 18:38:54 +01:00
|
|
|
/// Class BrowserLauncher.
|
2013-09-27 19:04:35 +02:00
|
|
|
/// </summary>
|
2013-09-25 02:54:51 +02:00
|
|
|
public static class BrowserLauncher
|
|
|
|
{
|
2013-09-27 19:04:35 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Opens the web client.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="appHost">The app host.</param>
|
2018-09-12 19:26:21 +02:00
|
|
|
public static void OpenWebApp(IServerApplicationHost appHost)
|
2013-09-27 19:04:35 +02:00
|
|
|
{
|
2020-03-15 13:00:34 +01:00
|
|
|
var url = appHost.GetLocalApiUrl("localhost") + "/web/index.html";
|
|
|
|
OpenUrl(appHost, url);
|
2013-09-27 19:04:35 +02:00
|
|
|
}
|
|
|
|
|
2020-02-25 17:01:57 +01:00
|
|
|
/// <summary>
|
|
|
|
/// Opens the swagger API page.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="appHost">The app host.</param>
|
|
|
|
public static void OpenSwaggerPage(IServerApplicationHost appHost)
|
|
|
|
{
|
|
|
|
var url = appHost.GetLocalApiUrl("localhost") + "/swagger/index.html";
|
|
|
|
OpenUrl(appHost, url);
|
|
|
|
}
|
|
|
|
|
2013-09-25 02:54:51 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Opens the URL.
|
|
|
|
/// </summary>
|
2019-11-01 18:38:54 +01:00
|
|
|
/// <param name="appHost">The application host instance.</param>
|
2013-09-25 02:54:51 +02:00
|
|
|
/// <param name="url">The URL.</param>
|
2016-04-24 05:03:49 +02:00
|
|
|
private static void OpenUrl(IServerApplicationHost appHost, string url)
|
2013-09-25 02:54:51 +02:00
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2016-04-24 05:03:49 +02:00
|
|
|
appHost.LaunchUrl(url);
|
|
|
|
}
|
2017-11-21 23:14:56 +01:00
|
|
|
catch (NotSupportedException)
|
2016-04-24 05:03:49 +02:00
|
|
|
{
|
2019-01-08 00:27:46 +01:00
|
|
|
|
2013-09-25 02:54:51 +02:00
|
|
|
}
|
2016-11-19 06:52:49 +01:00
|
|
|
catch (Exception)
|
2013-09-25 02:54:51 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|