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 }); }
/// <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&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 }); }