|
@@ -235,7 +235,13 @@ namespace Emby.Dlna.PlayTo
|
|
|
_logger.LogDebug("Setting mute");
|
|
|
var value = mute ? 1 : 0;
|
|
|
|
|
|
- await new SsdpHttpClient(_httpClientFactory).SendCommandAsync(Properties.BaseUrl, service, command.Name, rendererCommands.BuildPost(command, service.ServiceType, value))
|
|
|
+ await new SsdpHttpClient(_httpClientFactory)
|
|
|
+ .SendCommandAsync(
|
|
|
+ Properties.BaseUrl,
|
|
|
+ service,
|
|
|
+ command.Name,
|
|
|
+ rendererCommands.BuildPost(command, service.ServiceType, value),
|
|
|
+ cancellationToken: cancellationToken)
|
|
|
.ConfigureAwait(false);
|
|
|
|
|
|
IsMuted = mute;
|
|
@@ -270,7 +276,13 @@ namespace Emby.Dlna.PlayTo
|
|
|
// Remote control will perform better
|
|
|
Volume = value;
|
|
|
|
|
|
- await new SsdpHttpClient(_httpClientFactory).SendCommandAsync(Properties.BaseUrl, service, command.Name, rendererCommands.BuildPost(command, service.ServiceType, value))
|
|
|
+ await new SsdpHttpClient(_httpClientFactory)
|
|
|
+ .SendCommandAsync(
|
|
|
+ Properties.BaseUrl,
|
|
|
+ service,
|
|
|
+ command.Name,
|
|
|
+ rendererCommands.BuildPost(command, service.ServiceType, value),
|
|
|
+ cancellationToken: cancellationToken)
|
|
|
.ConfigureAwait(false);
|
|
|
}
|
|
|
|
|
@@ -291,7 +303,13 @@ namespace Emby.Dlna.PlayTo
|
|
|
throw new InvalidOperationException("Unable to find service");
|
|
|
}
|
|
|
|
|
|
- await new SsdpHttpClient(_httpClientFactory).SendCommandAsync(Properties.BaseUrl, service, command.Name, avCommands.BuildPost(command, service.ServiceType, string.Format(CultureInfo.InvariantCulture, "{0:hh}:{0:mm}:{0:ss}", value), "REL_TIME"))
|
|
|
+ await new SsdpHttpClient(_httpClientFactory)
|
|
|
+ .SendCommandAsync(
|
|
|
+ Properties.BaseUrl,
|
|
|
+ service,
|
|
|
+ command.Name,
|
|
|
+ avCommands.BuildPost(command, service.ServiceType, string.Format(CultureInfo.InvariantCulture, "{0:hh}:{0:mm}:{0:ss}", value), "REL_TIME"),
|
|
|
+ cancellationToken: cancellationToken)
|
|
|
.ConfigureAwait(false);
|
|
|
|
|
|
RestartTimer(true);
|
|
@@ -325,14 +343,21 @@ namespace Emby.Dlna.PlayTo
|
|
|
}
|
|
|
|
|
|
var post = avCommands.BuildPost(command, service.ServiceType, url, dictionary);
|
|
|
- await new SsdpHttpClient(_httpClientFactory).SendCommandAsync(Properties.BaseUrl, service, command.Name, post, header: header)
|
|
|
+ await new SsdpHttpClient(_httpClientFactory)
|
|
|
+ .SendCommandAsync(
|
|
|
+ Properties.BaseUrl,
|
|
|
+ service,
|
|
|
+ command.Name,
|
|
|
+ post,
|
|
|
+ header: header,
|
|
|
+ cancellationToken: cancellationToken)
|
|
|
.ConfigureAwait(false);
|
|
|
|
|
|
- await Task.Delay(50).ConfigureAwait(false);
|
|
|
+ await Task.Delay(50, cancellationToken).ConfigureAwait(false);
|
|
|
|
|
|
try
|
|
|
{
|
|
|
- await SetPlay(avCommands, CancellationToken.None).ConfigureAwait(false);
|
|
|
+ await SetPlay(avCommands, cancellationToken).ConfigureAwait(false);
|
|
|
}
|
|
|
catch
|
|
|
{
|
|
@@ -396,7 +421,13 @@ namespace Emby.Dlna.PlayTo
|
|
|
|
|
|
var service = GetAvTransportService();
|
|
|
|
|
|
- await new SsdpHttpClient(_httpClientFactory).SendCommandAsync(Properties.BaseUrl, service, command.Name, avCommands.BuildPost(command, service.ServiceType, 1))
|
|
|
+ await new SsdpHttpClient(_httpClientFactory)
|
|
|
+ .SendCommandAsync(
|
|
|
+ Properties.BaseUrl,
|
|
|
+ service,
|
|
|
+ command.Name,
|
|
|
+ avCommands.BuildPost(command, service.ServiceType, 1),
|
|
|
+ cancellationToken: cancellationToken)
|
|
|
.ConfigureAwait(false);
|
|
|
|
|
|
RestartTimer(true);
|
|
@@ -414,7 +445,13 @@ namespace Emby.Dlna.PlayTo
|
|
|
|
|
|
var service = GetAvTransportService();
|
|
|
|
|
|
- await new SsdpHttpClient(_httpClientFactory).SendCommandAsync(Properties.BaseUrl, service, command.Name, avCommands.BuildPost(command, service.ServiceType, 1))
|
|
|
+ await new SsdpHttpClient(_httpClientFactory)
|
|
|
+ .SendCommandAsync(
|
|
|
+ Properties.BaseUrl,
|
|
|
+ service,
|
|
|
+ command.Name,
|
|
|
+ avCommands.BuildPost(command, service.ServiceType, 1),
|
|
|
+ cancellationToken: cancellationToken)
|
|
|
.ConfigureAwait(false);
|
|
|
|
|
|
TransportState = TransportState.Paused;
|