private void SetupChromecast() {
            castDeviceManager = new ChromecastManager();
            castDeviceManager.ScanStarted += () => {
                statusLabel.Text = "Scan started";
            };
            castDeviceManager.ScanStopped += () => {
                statusLabel.Text = "Scan stopped";
            };
            castDeviceManager.DeviceCameOnline += (ChromecastDevice device) => {
                statusLabel.Text = String.Format("Online: {0}", device);

                castDeviceManager.StopScan();

                castDeviceManager.StartApplication(device, "YOUR_APPID_HERE");
            };
            castDeviceManager.ApplicationSessionStarted += (ChromecastSession session) => {
                ChromecastStream stream = new ChromecastStream(session, "other");
                statusLabel.Text = "ApplicationSessionStarted";
                stream.Send(new Dictionary<string, object>() { { "text", "Sent from my iPhone" } });
            };
            castDeviceManager.Scan(TimeSpan.FromSeconds(10));
        }
示例#2
0
 public ChromecastListener(ChromecastManager manager) {
     this.manager = manager;
 }
示例#3
0
 public ChromecastListener(ChromecastManager manager)
 {
     this.manager = manager;
 }