_service = new WebOsTv.Net.Service(client);
private async void btnMute_Click(object sender, EventArgs e)
{
if (_service != null)
{
await _service.Audio.MuteAsync();
}
}
// The channel selected in the listbox does not open on the TV.
private async void lstChannels_SelectedIndexChanged(object sender, EventArgs e)
{
if (_tvService != null && lstChannels.SelectedItem != null)
{
var selectedChannel = lstChannels.SelectedItem.ToString();
var channelId = selectedChannel.Split(‘-’)[0].Trim();
label1.Text = channelId; // show id
try
{
Console.WriteLine($"Attempting to set channel with ID: {channelId}");
// Seçili kanala geçiş yap
await _tvService.SetChannelAsync(channelId);
MessageBox.Show($"Kanal {channelId} ({selectedChannel}) was opened!");
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}\n{ex.StackTrace}");
}
}
}
Please help, any channel selected in the channel list on the TV does not open. What am I doing wrong?