コード例 #1
0
ファイル: Form1.cs プロジェクト: BO45/NCast
        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;
            }
        }
コード例 #2
0
ファイル: DeviceAggregate.cs プロジェクト: 4nd413/NCast
        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();
        }
コード例 #3
0
ファイル: ChromecastChannel.cs プロジェクト: 4nd413/NCast
 public ChromecastChannel(ChromecastClient client, string @ns)
 {
     Namespace = ns;
     _client = client;
 }
コード例 #4
0
 public ChromecastChannel(ChromecastClient client, string @ns)
 {
     Namespace = ns;
     _client   = client;
 }