private async void lstDeviceList_DoubleClick(object sender, EventArgs e) { var item = (SSDPResponse)lstDeviceList.SelectedItem; if (item != null && item.DeviceType == DeviceType.Chromecast) { var chromeCast = new ChromecastDevice(item); var info = await chromeCast.GetDetail(); lblAddress.Text = info.IpAddress; lblName.Text = info.Name; groupChromecast.Enabled = true; ChromecastClient = new ChromecastClient(item.Address, 8009); btnLaunchYoutube.Enabled = true; } }
public virtual async Task StartDevice() { var chromeCastReport = Report as ChromecastDeviceDiscoveryReportItem; Device = new ChromecastDevice(chromeCastReport ); Client = new ChromecastClient(chromeCastReport.EndPoint.Address, 8009); // <-- dat port number :( ConnectionChannel = Client.CreateChannel(DialConstants.DialConnectionUrn); HeartbeatChannel = Client.CreateChannel(DialConstants.DialHeartbeatUrn); ReceiverChannel = Client.CreateChannel(DialConstants.DialReceiverUrn); MediaChannel = Client.CreateChannel(DialConstants.DialMediaUrn); await Client.Connect(); Client.Listen(); // Send the connect message Client.Write(MessageFactory.Connect()); Client.StartHeartbeat(); }
public ChromecastChannel(ChromecastClient client, string @ns) { Namespace = ns; _client = client; }