Skip to content

Commit

Permalink
Changed how channels are referenced
Browse files Browse the repository at this point in the history
  • Loading branch information
Tapanila committed Jul 21, 2024
1 parent 8fec151 commit 5edf467
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Sharpcaster/ChromeCastClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ private void Receive()
var channel = Channels.FirstOrDefault(c => c.Namespace == castMessage.Namespace);
if (channel != null)
{
if (channel != GetChannel<IHeartbeatChannel>())
if (channel != HeartbeatChannel)
{
HeartbeatChannel.StopTimeoutTimer();
}
Expand Down Expand Up @@ -331,21 +331,21 @@ public async Task<ChromecastStatus> LaunchApplicationAsync(string applicationId,
var runningApplication = status?.Applications?.FirstOrDefault(x => x.AppId == applicationId);
if (runningApplication != null)
{
await GetChannel<IConnectionChannel>().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<IReceiverChannel>().GetChromecastStatusAsync();
return await ReceiverChannel.GetChromecastStatusAsync();
} else {
// another AppId is running
}
}
var newApplication = await GetChannel<IReceiverChannel>().LaunchApplicationAsync(applicationId);
await GetChannel<IConnectionChannel>().ConnectAsync(newApplication.Application.TransportId);
return await GetChannel<IReceiverChannel>().GetChromecastStatusAsync();
var newApplication = await ReceiverChannel.LaunchApplicationAsync(applicationId);
await ConnectionChannel.ConnectAsync(newApplication.Application.TransportId);
return await ReceiverChannel.GetChromecastStatusAsync();
}

private IEnumerable<IChromecastChannel> GetStatusChannels()
Expand Down

0 comments on commit 5edf467

Please sign in to comment.