Esempio n. 1
0
 public async Task SetMediaUrl(string url)
 {
     var uriMetadata = new UpnpArgument("CurrentURIMetaData", GetRadioMetadata("", "65031_"));
     var xml         = await _upnpClient.InvokeFuncWithResultAsync("SetAVTransportURI",
                                                                   new List <UpnpArgument>()
                                                                   { new UpnpArgument("InstanceID", 0), new UpnpArgument("CurrentURI", url), uriMetadata });
 }
Esempio n. 2
0
        /// <summary>
        /// Plays a radio on the Sonos
        /// </summary>
        /// <param name="uri"></param>
        /// <returns></returns>
        public async Task SetTuneInRadio(int radioId)
        {
            var radioUrl = $"x-sonosapi-stream:s{radioId}?sid=254&amp;flags=32";

            var uriMetadata = new UpnpArgument("CurrentURIMetaData", GetRadioMetadata("", "65031_"));
            var xml         = await _upnpClient.InvokeFuncWithResultAsync("SetAVTransportURI",
                                                                          new List <UpnpArgument>()
                                                                          { new UpnpArgument("InstanceID", 0), new UpnpArgument("CurrentURI", radioUrl), uriMetadata });
        }