Exemple #1
0
        MediaDeviceInfo ParseDevice(MMDevice device)
        {
            MediaDeviceType type = MediaDeviceType.Unknown;

            switch (device.Icon)
            {
            case DeviceIcon.Speakers:
                type = MediaDeviceType.Speakers;
                break;

            case DeviceIcon.Phone:
                type = MediaDeviceType.Phone;
                break;

            case DeviceIcon.Digital:
                type = MediaDeviceType.Digital;
                break;

            case DeviceIcon.Monitor:
                type = MediaDeviceType.Monitor;
                break;
            }

            return(new MediaDeviceInfo(device.Id, device.RealName, device.FriendlyName, type, device.AudioEndpointVolume.Mute));
        }
Exemple #2
0
 public MediaDeviceInfo(String id, String realName, String friendlyName, MediaDeviceType type, bool mute)
 {
     Id           = id;
     RealName     = realName;
     FriendlyName = friendlyName;
     Type         = type;
     Mute         = mute;
 }
Exemple #3
0
 private void deviceCombItemUpdate(ComboBox cmb, MediaDeviceType mediaDeviceType)
 {
     if (MediaDeviceType.AudioOutput == mediaDeviceType)
     {
         if (_outputDev == null)
         {
             if (!outputUpdate)
             {
                 _device.PhoneGetSoundDevice(false);
             }
         }
         else
         {
             cmb.Items.Clear();
             foreach (var dev in _outputDev)
             {
                 cmb.Items.Add(dev.deviceName);
             }
         }
     }
     else if (MediaDeviceType.AudioInput == mediaDeviceType)
     {
         if (_inputDev == null)
         {
             if (!inputUpdate)
             {
                 _device.PhoneGetSoundDevice(true);
             }
         }
         else
         {
             cmb.Items.Clear();
             foreach (var dev in _inputDev)
             {
                 cmb.Items.Add(dev.deviceName);
             }
         }
     }
     else
     {
         if (_videoDev == null)
         {
             if (!videoUpdate)
             {
                 _device.PhoneGetVideoDevice();
             }
         }
         else
         {
             cmb.Items.Clear();
             foreach (var dev in _videoDev)
             {
                 cmb.Items.Add(dev.deviceName);
             }
         }
     }
 }
        private void FillInDeviceSelection(MediaDeviceType deviceType, NSPopUpButton deviceSelection, List <AgoraRtcDeviceInfo> deviceMap)
        {
            deviceSelection.RemoveAllItems();
            deviceMap.Clear();
            var devices = _agoraKit.EnumerateDevices(deviceType);

            foreach (var device in devices)
            {
                deviceSelection.AddItem(device.DeviceName);
                deviceMap.Add(device);
            }
        }
Exemple #5
0
 private void OnMediaDevicesChanged(MediaDeviceType mediaType)
 {
     switch (mediaType)
     {
     case MediaDeviceType.MediaDeviceType_VideoCapture:
         RefreshVideoCaptureDevices(Conductor.Instance.Media.GetVideoCaptureDevices());
         break;
         // WebRTCUWP M58 library does not support audio capture/playout devices
         //case MediaDeviceType.MediaDeviceType_AudioCapture:
         //    RefreshAudioCaptureDevices(Conductor.Instance.Media.GetAudioCaptureDevices());
         //    break;
         //case MediaDeviceType.MediaDeviceType_AudioPlayout:
         //    RefreshAudioPlayoutDevices(Conductor.Instance.Media.GetAudioPlayoutDevices());
         //    break;
     }
 }
        private void OnMediaDevicesChanged(MediaDeviceType mediaType)
        {
            switch (mediaType)
            {
            case MediaDeviceType.MediaDeviceType_VideoCapture:
                RefreshVideoCaptureDevices(Conductor.Instance.Media.GetVideoCaptureDevices());
                break;

            case MediaDeviceType.MediaDeviceType_AudioCapture:
                RefreshAudioCaptureDevices(Conductor.Instance.Media.GetAudioCaptureDevices());
                break;

            case MediaDeviceType.MediaDeviceType_AudioPlayout:
                RefreshAudioPlayoutDevices(Conductor.Instance.Media.GetAudioPlayoutDevices());
                break;
            }
        }
Exemple #7
0
        public void SetDeviceInfo(List <SoundDeviceInfo> deviceList, MediaDeviceType mediaDeviceType)
        {
            if (deviceList == null)
            {
                return;
            }

            if (MediaDeviceType.AudioOutput == mediaDeviceType)
            {
                _outputDev   = deviceList;
                outputUpdate = true;
                mainSpkComb.Items.Clear();
                AidSpkComb.Items.Clear();
            }
            else if (MediaDeviceType.AudioInput == mediaDeviceType)
            {
                _inputDev   = deviceList;
                inputUpdate = true;
                mainMicComb.Items.Clear();
                AidMicComb.Items.Clear();
            }
            else
            {
                _videoDev   = deviceList;
                videoUpdate = true;
                VideoDeviceComb.Items.Clear();
            }

            foreach (var dev in deviceList)
            {
                if (MediaDeviceType.AudioOutput == mediaDeviceType)
                {
                    mainSpkComb.Items.Add(dev.deviceName);
                    AidSpkComb.Items.Add(dev.deviceName);
                }
                else if (MediaDeviceType.AudioInput == mediaDeviceType)
                {
                    mainMicComb.Items.Add(dev.deviceName);
                    AidMicComb.Items.Add(dev.deviceName);
                }
                else
                {
                    VideoDeviceComb.Items.Add(dev.deviceName);
                }
            }
        }
        public MediaRenderer(IEventAggregator eventAggregatorInstance, IMessagingService messagingServiceInstance, INetWorkSubscriber netWorkSubscriberInstance, DeviceDescription deviceDescription, string ipAddress, int port, MediaDeviceType deviceType)
        {
            eventAggregator   = eventAggregatorInstance;
            messagingService  = messagingServiceInstance;
            netWorkSubscriber = netWorkSubscriberInstance;

            this.deviceDescription = deviceDescription;
            this.ipAddress         = ipAddress;
            this.port = port;

            DeviceType = deviceType;

            //Key: Action.Name, Value: ServiceAction
            ServiceActions = new Dictionary <string, ServiceAction>();

            //Key: ServiceType, Value: Uri-String
            serviceSCPDs    = new List <NetWorkSubscriberPayload>();
            serviceControls = new List <NetWorkSubscriberPayload>();
            serviceEvents   = new List <NetWorkSubscriberPayload>();
        }
        private static async void OnMediaDevicesChanged(MediaDeviceType mediaType)
        {
            var changeType = MediaDeviceChangeType.Unknown;

            switch (mediaType)
            {
            case MediaDeviceType.MediaDeviceType_AudioCapture:
                changeType = MediaDeviceChangeType.AudioCapture;
                break;

            case MediaDeviceType.MediaDeviceType_AudioPlayout:
                changeType = MediaDeviceChangeType.AudioPlayout;
                break;

            case MediaDeviceType.MediaDeviceType_VideoCapture:
                changeType = MediaDeviceChangeType.VideoCapture;
                break;
            }
            await Hub.Instance.OnChangeMediaDevices(new MediaDevicesChange
            {
                Type = changeType
            });
        }
Exemple #10
0
        static void Main(string[] args)
        {
            /************************************************************
            * Please change these accordingly to your own environment  *
            ************************************************************/
            String username = "";
            String password = "";
            String domain   = "";

            AuthenticationType authType    = AuthenticationType.WindowsDefault;
            String             hostAddress = "localhost";
            int port = 80;

            if (authType == AuthenticationType.Basic)
            {
                port = 443; //SSL
            }

            /************************************************************
            * Beginning of program                                     *
            ************************************************************/
            Console.WriteLine("Milestone SDK Bookmarks demo (XProtect Corporate only)");
            Console.WriteLine("Creates 2 new bookmarks and retrieves them using ");
            Console.WriteLine("  1) BookmarkSearchTime ");
            Console.WriteLine("  2) BookmarkSearchFromBookmark");
            Console.WriteLine("  3) BookmarkGet");
            Console.WriteLine("  4) BookmarkDelete");
            Console.WriteLine("");


            #region Connect to the Management Server, get configuration, and extract the cameras

            RecorderInfo[]             recorderInfo = new RecorderInfo[0];
            LoginInfo                  loginInfo    = null;
            ServerCommandServiceClient scs          = null;
            switch (authType)
            {
            case AuthenticationType.Basic:
                _basicConnection = new BasicConnection(username, password, hostAddress, port);
                loginInfo        = _basicConnection.Login(IntegrationId, Version, IntegrationName);
                _basicConnection.GetConfiguration(loginInfo.Token);

                ConfigurationInfo confInfoBasic =
                    _basicConnection.ConfigurationInfo;
                recorderInfo = confInfoBasic.Recorders;

                scs = _basicConnection.Server;

                break;

            case AuthenticationType.Windows:
            case AuthenticationType.WindowsDefault:
                _ntlmConnection = new NtlmConnection(domain, authType, username, password, hostAddress,
                                                     port);
                loginInfo = _ntlmConnection.Login(IntegrationId, Version, IntegrationName);
                _ntlmConnection.GetConfiguration(loginInfo.Token);

                ConfigurationInfo confInfoNtlm = _ntlmConnection.ConfigurationInfo;
                recorderInfo = confInfoNtlm.Recorders;

                scs = _ntlmConnection.Server;
                break;

            default:
                //Empty
                break;
            }

            #endregion

            #region Find recording servers attached to the management server

            //Get recording servers
            int recorders = recorderInfo.Length;
            Console.WriteLine("{0} Corporate Recording Server found", recorders);
            if (recorders == 0)
            {
                Console.WriteLine("");
                Console.WriteLine("Press any key");
                Console.ReadKey();
                return;
            }

            #endregion


            DateTime timeNow = DateTime.Now;

            // get cameras for the first recorder
            RecorderInfo recorder = recorderInfo[0];
            Console.WriteLine("");
            Console.WriteLine("Processing recording server {0}", recorder.Name);
            Console.WriteLine("");

            #region Find all cameras defined on the recording server

            // extract info about the recording server
            List <CameraInfo> cameras = recorder.Cameras.ToList();

            #endregion



            // now-5:10min:                                       BookmarkSearchTime start
            // now-5:00min: (beginTime)                                         |                                                  BookmarkGet
            // now-4:59min: start recording 1                                   |
            // now-4:55min: start bookmark 1                                    |
            // now-4:45min: end bookmark 1                                      |
            //                                                                  |                BookmarkSearchFromBookmark
            // now-2:00min:                                                     |                            |
            // now-1:59min: start recording 2                                   |                            |
            // now-1:55min: start bookmark 2 (trigger time)                     |                            |
            // now-1:45min: end bookmark 2                                      |                            |
            // now                                                              v                            V

            #region create first bookmark

            Guid cameraGuid = cameras.First().DeviceId;

            Console.WriteLine("Creating the first bookmark");
            MediaDeviceType[] mediaDeviceTypes = new MediaDeviceType[3];
            mediaDeviceTypes[0] = MediaDeviceType.Camera;
            mediaDeviceTypes[1] = MediaDeviceType.Microphone;
            mediaDeviceTypes[2] = MediaDeviceType.Speaker;



            DateTime     timeBegin = timeNow.AddMinutes(-5);
            TimeDuration td        = new TimeDuration()
            {
                MicroSeconds = (int)TimeSpan.FromMinutes(30).TotalMilliseconds * 1000
            };

            StringBuilder bookmarkRef    = new StringBuilder();
            StringBuilder bookmarkHeader = new StringBuilder();
            StringBuilder bookmarkDesc   = new StringBuilder();
            bookmarkRef.AppendFormat("MyBookmark-{0}", timeBegin.ToLongTimeString());
            bookmarkHeader.AppendFormat("AutoBookmark-{0}", timeBegin.ToLongTimeString());
            bookmarkDesc.AppendFormat("AutoBookmark-{0} set for a duration of {1} seconds",
                                      timeBegin.ToLongTimeString(), (timeBegin.AddSeconds(10) - timeBegin.AddSeconds(1)).Seconds);

            Bookmark newBookmark = null;
            try
            {
                newBookmark = scs.BookmarkCreate(loginInfo.Token, cameraGuid,
                                                 timeBegin.AddSeconds(1),
                                                 timeBegin.AddSeconds(5),
                                                 timeBegin.AddSeconds(10),
                                                 bookmarkRef.ToString(),
                                                 bookmarkHeader.ToString(),
                                                 bookmarkDesc.ToString());
            }
            catch (Exception ex)
            {
                Console.WriteLine("BookmarkCreate: " + ex.Message);
                Console.WriteLine("Press any Key to exit...");
                Console.ReadKey();
                Environment.Exit(0);
            }

            if (newBookmark == null)
            {
                Console.WriteLine("New bookmark wasn't created.");
                Console.WriteLine("Press any key to exit.");
                Console.ReadKey();
                Environment.Exit(0);
            }

            Console.WriteLine("-> trigger time = {0}", newBookmark.TimeTrigged);
            Console.WriteLine("");


            #endregion

            Console.WriteLine("");
            Console.WriteLine("Waiting 20 sec ....");
            Console.WriteLine("");
            System.Threading.Thread.Sleep(TimeSpan.FromSeconds(20));

            #region Create a second bookmark

            Console.WriteLine("Creating a second bookmark - 2 minutes after the first bookmark");
            DateTime timeBegin2 = timeBegin.AddMinutes(2);
            bookmarkHeader.Length = 0;
            bookmarkDesc.Length   = 0;
            StringBuilder bookmarkRef2 = new StringBuilder();
            bookmarkRef2.AppendFormat("MyBookmark-{0}", timeBegin2.ToLongTimeString());
            bookmarkHeader.AppendFormat("AutoBookmark-{0}", timeBegin2.ToLongTimeString());
            bookmarkDesc.AppendFormat("AutoBookmark-{0} set for a duration of {1} seconds",
                                      timeBegin2.ToLongTimeString(), (timeBegin2.AddSeconds(10) - timeBegin2.AddSeconds(1)).Seconds);
            Bookmark newBookmark2 = scs.BookmarkCreate(loginInfo.Token, cameraGuid, timeBegin2.AddSeconds(1),
                                                       timeBegin2.AddSeconds(5), timeBegin2.AddSeconds(10)
                                                       , bookmarkRef2.ToString(), bookmarkHeader.ToString(), bookmarkDesc.ToString());

            Console.WriteLine("-> trigger time = {0}", newBookmark2.TimeTrigged);
            Console.WriteLine("");

            #endregion

            #region BookmarkSearchTime

            // Get max 10 of the bookmarks created after the specified time
            Console.WriteLine("");
            Console.WriteLine("Looking for bookmarks using BookmarkSearchTime (finding the 2 newly created)");
            Bookmark[] bookmarkList = scs.BookmarkSearchTime(loginInfo.Token, newBookmark.TimeBegin.AddSeconds(-10), td,
                                                             10, mediaDeviceTypes, new Guid[0], new string[0], "");
            if (bookmarkList.Length > 0)
            {
                Console.WriteLine("-> Found {0} bookmark(s)", bookmarkList.Length);
                int counter = 1;
                foreach (Bookmark bookmark in bookmarkList)
                {
                    Console.WriteLine("{0}:", counter);
                    Console.WriteLine("     Id  ={0} ", bookmark.Id);
                    Console.WriteLine("     Name={0} ", bookmark.Header);
                    Console.WriteLine("     Desc={0} ", bookmark.Description);
                    Console.WriteLine("     user={0} ", bookmark.User);
                    Console.WriteLine("     Device={0} Start={1} Stop={2}  ", bookmark.DeviceId, bookmark.TimeBegin,
                                      bookmark.TimeEnd);
                    counter++;
                }
            }
            else
            {
                Console.WriteLine("sorry no bookmarks found");
            }

            Console.WriteLine("");

            #endregion

            #region BookmarkSearchFromBookmark

            // Get the next (max 10) bookmarks after the first
            Console.WriteLine(
                "Looking for bookmarks using BookmarkSearchFromBookmark (finding the last of the 2 newly created)");
            Bookmark[] bookmarkListsFromBookmark = scs.BookmarkSearchFromBookmark(loginInfo.Token, newBookmark.Id, td,
                                                                                  10, mediaDeviceTypes, new Guid[0], new string[0], "");
            if (bookmarkListsFromBookmark.Length > 0)
            {
                Console.WriteLine("-> Found {0} bookmark(s)", bookmarkListsFromBookmark.Length);
                int counter = 1;
                foreach (Bookmark bookmark in bookmarkListsFromBookmark)
                {
                    Console.WriteLine("{0}:", counter);
                    Console.WriteLine("     Id  ={0} ", bookmark.Id);
                    Console.WriteLine("     Name={0} ", bookmark.Header);
                    Console.WriteLine("     Desc={0} ", bookmark.Description);
                    Console.WriteLine("     user={0} ", bookmark.User);
                    Console.WriteLine("     Device={0} Start={1} Stop={2}  ", bookmark.DeviceId, bookmark.TimeBegin,
                                      bookmark.TimeEnd);
                    counter++;
                }
            }
            else
            {
                Console.WriteLine("sorry no bookmarks found");
            }

            Console.WriteLine("");

            #endregion

            #region BookmarkGet

            // Get first created bookmark
            Console.WriteLine(
                "Looking for the first bookmarks using BookmarkGet  (finding the first of the 2 newly created)");
            Bookmark newBookmarkFetched = scs.BookmarkGet(loginInfo.Token, newBookmark.Id);
            if (newBookmarkFetched != null)
            {
                Console.WriteLine("-> A bookmarks is found");
                Console.WriteLine("     Id  ={0} ", newBookmarkFetched.Id);
                Console.WriteLine("     Name={0} ", newBookmarkFetched.Header);
                Console.WriteLine("     Desc={0} ", newBookmarkFetched.Description);
                Console.WriteLine("     user={0} ", newBookmarkFetched.User);
                Console.WriteLine("     Device={0} Start={1} Stop={2}  ", newBookmarkFetched.DeviceId,
                                  newBookmarkFetched.TimeBegin, newBookmarkFetched.TimeEnd);
            }
            else
            {
                Console.WriteLine("Sorry no bookmarks found");
            }

            Console.WriteLine("");

            #endregion

            #region Deleting bookmarks

            Console.WriteLine("Deleting 2 newly created bookmarks");
            scs.BookmarkDelete(loginInfo.Token, newBookmark.Id);
            Console.WriteLine("   -> first deleted");
            scs.BookmarkDelete(loginInfo.Token, newBookmark2.Id);
            Console.WriteLine("   -> second deleted");

            #endregion



            Console.WriteLine("");
            Console.WriteLine("Press any key");
            Console.ReadKey();
        }
        /// <summary>
        /// Creates a new instance of IMediaDevice
        /// </summary>
        /// <param name="rendererDescription">URI, where to fetch the MediaDevice desciptions</param>
        /// <param name="mediaDeviceType">MediaDevicetype, e.g. MediaServer</param>
        /// <returns></returns>
        private async Task <IMediaDevice> loadMediaDeviceAsync(string rendererDescription, MediaDeviceType mediaDeviceType)
        {
            try
            {
                if (!string.IsNullOrEmpty(rendererDescription))
                {
                    Uri serverUri  = new Uri(rendererDescription);
                    var httpFilter = new Windows.Web.Http.Filters.HttpBaseProtocolFilter();
                    httpFilter.CacheControl.ReadBehavior = Windows.Web.Http.Filters.HttpCacheReadBehavior.NoCache;
                    using (HttpClient client = new HttpClient(httpFilter))
                    {
                        using (HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, serverUri))
                        {
                            request.Headers.Add("User-Agent", "RaumfeldControl/0.0 RaumfeldProtocol/1");    /* RaumfeldControl/3.6 RaumfeldProtocol/399 Build => https://github.com/masmu/pulseaudio-dlna/issues/227 */
                            request.Headers.Add("Accept-Language", "en");
                            request.Headers.Add("ContentType", "text/xml; charset=\"utf - 8\"");

                            using (HttpResponseMessage response = await client.SendRequestAsync(request))
                            {
                                if (response.StatusCode == Windows.Web.Http.HttpStatusCode.Ok)
                                {
                                    string xmlString = await response.Content.ReadAsStringAsync();

                                    XmlDocument xmlDocument = new XmlDocument();
                                    xmlDocument.LoadXml(xmlString);
                                    if (xmlDocument != null)
                                    {
                                        DeviceDescription deviceDescription = xmlDocument.GetXml().Deserialize <DeviceDescription>();
                                        IMediaDevice      device;

                                        if (mediaDeviceType == MediaDeviceType.MediaServer)
                                        {
                                            device = PrismUnityApplication.Current.Container.Resolve <MediaServer>(new ResolverOverride[]
                                            {
                                                new ParameterOverride("deviceDescription", deviceDescription), new ParameterOverride("ipAddress", serverUri.Host), new ParameterOverride("port", serverUri.Port),
                                            });

                                            await device.InitializeAsync();

                                            return(device);
                                        }
                                        else
                                        {
                                            device = PrismUnityApplication.Current.Container.Resolve <MediaRenderer>(new ResolverOverride[]
                                            {
                                                new ParameterOverride("deviceDescription", deviceDescription), new ParameterOverride("ipAddress", serverUri.Host), new ParameterOverride("port", serverUri.Port), new ParameterOverride("deviceType", mediaDeviceType),
                                            });

                                            await device.InitializeAsync();

                                            return(device);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception)
            {
                return(null);
            }

            return(null);
        }
Exemple #12
0
        /// <summary>
        /// Get Raumfeld DeviceDescription and create new MediaServer
        /// </summary>
        /// <returns></returns>
        //private async Task<MediaServer> loadMediaServerAsync()
        //{
        //    //if ((raumfeldDevices?.Devices?.Count() ?? 0) == 0 || server == null) { return null; }

        //    string uuid = ((Guid)server.Properties["System.Devices.ContainerId"]).ToString().ToLower();
        //    try
        //    {
        //        string serverDescription = raumfeldDevices.Devices.Where(server => server.Udn.Replace("uuid:", "").ToLower() == uuid).Select(server => server.Location).FirstOrDefault();

        //        if (!string.IsNullOrEmpty(serverDescription))
        //        {
        //            Uri serverUri = new Uri(serverDescription);
        //            var httpFilter = new Windows.Web.Http.Filters.HttpBaseProtocolFilter();
        //            httpFilter.CacheControl.ReadBehavior = Windows.Web.Http.Filters.HttpCacheReadBehavior.NoCache;
        //            using (HttpClient client = new HttpClient())
        //            {
        //                using (HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, serverUri))
        //                {
        //                    request.Headers.Add("User-Agent", "RaumfeldControl/0.0 RaumfeldProtocol/1");    /* RaumfeldControl/3.6 RaumfeldProtocol/399 Build => https://github.com/masmu/pulseaudio-dlna/issues/227 */
        //                    request.Headers.Add("Accept-Language", "en");
        //                    request.Headers.Add("ContentType", "text/xml; charset=\"utf - 8\"");

        //                    using (HttpResponseMessage response = await client.SendRequestAsync(request))
        //                    {
        //                        if (response.StatusCode == Windows.Web.Http.HttpStatusCode.Ok)
        //                        {
        //                            string xmlString = await response.Content.ReadAsStringAsync();

        //                            XmlDocument xmlDocument = new XmlDocument();
        //                            xmlDocument.LoadXml(xmlString);
        //                            if (xmlDocument != null)
        //                            {
        //                                DeviceDescription deviceDescription = xmlDocument.GetXml().Deserialize<DeviceDescription>();
        //                                MediaServer mediaServer = new MediaServer(deviceDescription, serverUri.Host, serverUri.Port)
        //                                {
        //                                    DeviceType = MediaDeviceType.MediaServer
        //                                };

        //                                await mediaServer.LoadServicesAsync();

        //                                return mediaServer;
        //                            }
        //                        }
        //                    }
        //                }
        //            }
        //        }
        //    }
        //    catch (Exception exception)
        //    {
        //        await UIService.ShowDialogAsync(string.Format("{0} {1}: {2}", UIService.GetResource("Error"), exception.HResult, exception.Message), "LoadMediaServer");
        //        Logger.GetLogger().SaveMessage(exception, "LoadMediaServerAsync");
        //    }
        //    return null;
        //}

        /// <summary>
        /// Get Raumfeld DeviceDescription and create new MediaRenderer
        /// </summary>
        /// <returns></returns>
        //private async Task<MediaRenderer> loadMediaRendererAsync(string rendererDescription, MediaDeviceType mediaDeviceType)
        //{
        //    //if ((raumfeldDevices?.Devices?.Count() ?? 0) == 0 || server == null) { return null; }

        //    try
        //    {
        //        if (!string.IsNullOrEmpty(rendererDescription))
        //        {
        //            Uri serverUri = new Uri(rendererDescription);
        //            var httpFilter = new Windows.Web.Http.Filters.HttpBaseProtocolFilter();
        //            httpFilter.CacheControl.ReadBehavior = Windows.Web.Http.Filters.HttpCacheReadBehavior.NoCache;
        //            using (HttpClient client = new HttpClient(httpFilter))
        //            {
        //                using (HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, serverUri))
        //                {
        //                    request.Headers.Add("User-Agent", "RaumfeldControl/0.0 RaumfeldProtocol/1");    /* RaumfeldControl/3.6 RaumfeldProtocol/399 Build => https://github.com/masmu/pulseaudio-dlna/issues/227 */
        //                    request.Headers.Add("Accept-Language", "en");
        //                    request.Headers.Add("ContentType", "text/xml; charset=\"utf - 8\"");

        //                    using (HttpResponseMessage response = await client.SendRequestAsync(request))
        //                    {
        //                        if (response.StatusCode == Windows.Web.Http.HttpStatusCode.Ok)
        //                        {
        //                            string xmlString = await response.Content.ReadAsStringAsync();

        //                            XmlDocument xmlDocument = new XmlDocument();
        //                            xmlDocument.LoadXml(xmlString);
        //                            if (xmlDocument != null)
        //                            {
        //                                DeviceDescription deviceDescription = xmlDocument.GetXml().Deserialize<DeviceDescription>();

        //                                MediaRenderer mediaRenderer = new MediaRenderer(deviceDescription, serverUri.Host, serverUri.Port);
        //                                await mediaRenderer.LoadServicesAsync();

        //                                mediaRenderer.DeviceType = mediaDeviceType;

        //                                return mediaRenderer;
        //                            }
        //                        }
        //                    }
        //                }
        //            }
        //        }
        //    }
        //    catch (Exception exception)
        //    {
        //        await UIService.ShowDialogAsync(string.Format("{0} {1}: {2}", UIService.GetResource("Error"), exception.HResult, exception.Message), "LoadMediaRenderer");
        //        Logger.GetLogger().SaveMessage(exception, "LoadMediaRendererAsync");
        //    }

        //    return null;
        //}

        /// <summary>
        /// Get Raumfeld DeviceDescription and create new MediaRenderer
        /// </summary>
        /// <returns></returns>
        private async Task <MediaDevice> loadMediaDeviceAsync(string rendererDescription, MediaDeviceType mediaDeviceType)
        {
            try
            {
                if (!string.IsNullOrEmpty(rendererDescription))
                {
                    Uri serverUri  = new Uri(rendererDescription);
                    var httpFilter = new Windows.Web.Http.Filters.HttpBaseProtocolFilter();
                    httpFilter.CacheControl.ReadBehavior = Windows.Web.Http.Filters.HttpCacheReadBehavior.NoCache;
                    using (HttpClient client = new HttpClient(httpFilter))
                    {
                        using (HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, serverUri))
                        {
                            request.Headers.Add("User-Agent", "RaumfeldControl/0.0 RaumfeldProtocol/1");    /* RaumfeldControl/3.6 RaumfeldProtocol/399 Build => https://github.com/masmu/pulseaudio-dlna/issues/227 */
                            request.Headers.Add("Accept-Language", "en");
                            request.Headers.Add("ContentType", "text/xml; charset=\"utf - 8\"");

                            using (HttpResponseMessage response = await client.SendRequestAsync(request))
                            {
                                if (response.StatusCode == Windows.Web.Http.HttpStatusCode.Ok)
                                {
                                    string xmlString = await response.Content.ReadAsStringAsync();

                                    XmlDocument xmlDocument = new XmlDocument();
                                    xmlDocument.LoadXml(xmlString);
                                    if (xmlDocument != null)
                                    {
                                        DeviceDescription deviceDescription = xmlDocument.GetXml().Deserialize <DeviceDescription>();

                                        if (mediaDeviceType == MediaDeviceType.MediaServer)
                                        {
                                            MediaServer mediaServer = new MediaServer(deviceDescription, serverUri.Host, serverUri.Port)
                                            {
                                                DeviceType = mediaDeviceType
                                            };
                                            await mediaServer.LoadServicesAsync();

                                            return(mediaServer);
                                        }
                                        else
                                        {
                                            MediaRenderer mediaRenderer = new MediaRenderer(deviceDescription, serverUri.Host, serverUri.Port)
                                            {
                                                DeviceType = mediaDeviceType
                                            };
                                            await mediaRenderer.LoadServicesAsync();

                                            mediaRenderer.DeviceType = mediaDeviceType;

                                            return(mediaRenderer);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                await UIService.ShowDialogAsync(string.Format("{0} {1}: {2}", UIService.GetResource("Error"), exception.HResult, exception.Message), "loadMediaDeviceAsync");

                Logger.GetLogger().SaveMessage(exception, "loadMediaDeviceAsync");
            }

            return(null);
        }