public void Start(IPCameraController controller) { try { _mjpeg.ParseStream(new Uri(controller.GetMJpegURL())); } catch (Exception ex) { Debug.WriteLine(ex); OnError(ex.ToString()); } beacon = Beacon.Attach(controller.GetMJpegURL()); }
public void SetConfig(CameraObject conf) { Title = conf.Title; URL = conf.URL; Username = conf.Username; Password = conf.Password; Config = conf; Config.Update = this; Controller = new IPCameraController(URL, Username, Password); if (IsRunning) { Stop(); Start(); } if (string.IsNullOrEmpty(conf.Timezone)) { // FIXME: we shouldn't have this problem, but possibly still do. conf.Timezone = "America/New_York"; } // for com.davux.FoscamController, options is defined as: // <Camera snapshot URL> [<PHP Timezone> <Tile Link Page>] // just URL is v1 appcompat PushNotifications.RegisterApp(PushNotifications.ChannelName, Title, string.Format("{0} {1} {2}", Controller.GetSnapshotURL(), conf.Timezone, new Uri(Uri.EscapeUriString(String.Format("/Camera.xaml?Title={0}", conf.Title)), UriKind.Relative).ToString()), (success, message) => { Debug.WriteLine("RegisterApp: " + success + " " + message); }); }