From e5a0d8dd8442e17a3ef398933a040bab77f8472f Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 30 Apr 2016 01:35:53 -0400 Subject: [PATCH] update mac project --- MediaBrowser.Server.Mac/Native/BaseMonoApp.cs | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.Server.Mac/Native/BaseMonoApp.cs b/MediaBrowser.Server.Mac/Native/BaseMonoApp.cs index abc3736009..9c7421e429 100644 --- a/MediaBrowser.Server.Mac/Native/BaseMonoApp.cs +++ b/MediaBrowser.Server.Mac/Native/BaseMonoApp.cs @@ -8,6 +8,7 @@ using System.Reflection; using System.Text.RegularExpressions; using MediaBrowser.Controller.Power; using MediaBrowser.Server.Startup.Common.FFMpeg; +using System.Diagnostics; namespace MediaBrowser.Server.Mac { @@ -109,7 +110,38 @@ namespace MediaBrowser.Server.Mac public void LaunchUrl(string url) { - throw new NotImplementedException(); + var process = new Process + { + StartInfo = new ProcessStartInfo + { + FileName = url + }, + + EnableRaisingEvents = true, + }; + + process.Exited += ProcessExited; + + try + { + process.Start(); + } + catch (Exception ex) + { + _logger.ErrorException("Error launching url: {0}", ex, url); + + throw; + } + } + + /// + /// Processes the exited. + /// + /// The sender. + /// The instance containing the event data. + private static void ProcessExited(object sender, EventArgs e) + { + ((Process)sender).Dispose(); } public FFMpegInstallInfo GetFfmpegInstallInfo()