diff --git a/Sharpcaster/ChromeCastClient.cs b/Sharpcaster/ChromeCastClient.cs index 926e614..35af497 100644 --- a/Sharpcaster/ChromeCastClient.cs +++ b/Sharpcaster/ChromeCastClient.cs @@ -155,7 +155,7 @@ private void Receive() var channel = Channels.FirstOrDefault(c => c.Namespace == castMessage.Namespace); if (channel != null) { - if (channel != GetChannel()) + if (channel != HeartbeatChannel) { HeartbeatChannel.StopTimeoutTimer(); } @@ -331,21 +331,21 @@ public async Task LaunchApplicationAsync(string applicationId, var runningApplication = status?.Applications?.FirstOrDefault(x => x.AppId == applicationId); if (runningApplication != null) { - await GetChannel().ConnectAsync(runningApplication.TransportId); + await ConnectionChannel.ConnectAsync(runningApplication.TransportId); //Check if the application is using the media namespace //If so go and get the media status if (runningApplication.Namespaces.Where(ns => ns.Name == "urn:x-cast:com.google.cast.media") != null) { await MediaChannel.GetMediaStatusAsync(); } - return await GetChannel().GetChromecastStatusAsync(); + return await ReceiverChannel.GetChromecastStatusAsync(); } else { // another AppId is running } } - var newApplication = await GetChannel().LaunchApplicationAsync(applicationId); - await GetChannel().ConnectAsync(newApplication.Application.TransportId); - return await GetChannel().GetChromecastStatusAsync(); + var newApplication = await ReceiverChannel.LaunchApplicationAsync(applicationId); + await ConnectionChannel.ConnectAsync(newApplication.Application.TransportId); + return await ReceiverChannel.GetChromecastStatusAsync(); } private IEnumerable GetStatusChannels()