Exemple #1
0
            public static CaptureSession Create(SelfView parent)
            {
                // create a device input and attach it to the session
                var captureDevice = AVCaptureDevice.DevicesWithMediaType(AVMediaType.Video).FirstOrDefault(d => d.Position == AVCaptureDevicePosition.Front);

                if (captureDevice == null)
                {
                    return(null);
                }

                var input = AVCaptureDeviceInput.FromDevice(captureDevice);

                if (input == null)
                {
                    return(null);
                }

                var output = new AVCaptureMetadataOutput();
                var cs     = new CaptureSession(parent, input, output);

                // This must be set after the output is added to the sesssion
                output.MetadataObjectTypes = AVMetadataObjectType.Face;

                return(cs);
            }
Exemple #2
0
        public override async void ViewDidAppear(bool animated)
        {
            base.ViewDidAppear(animated);

            // Only start video if we're not in the designer
            SelfView.Start();
            // Give a second and then hide adornments
            await Task.Delay(TimeSpan.FromSeconds(1.5));

            OnTapped(null);
        }
Exemple #3
0
            private CaptureSession(SelfView parent, AVCaptureDeviceInput input, AVCaptureMetadataOutput output)
            {
                this.parent  = parent;
                this.queue   = new DispatchQueue("myQueue");
                this.session = new AVCaptureSession {
                    SessionPreset = AVCaptureSession.PresetMedium
                };

                session.AddInput(input);

                output.SetDelegate(this, queue);
                session.AddOutput(output);
            }
Exemple #4
0
        void ReleaseDesignerOutlets()
        {
            if (CallButton != null)
            {
                CallButton.Dispose();
                CallButton = null;
            }

            if (CallView != null)
            {
                CallView.Dispose();
                CallView = null;
            }

            if (NavBar != null)
            {
                NavBar.Dispose();
                NavBar = null;
            }

            if (NoveltyBottomConstraint != null)
            {
                NoveltyBottomConstraint.Dispose();
                NoveltyBottomConstraint = null;
            }

            if (NoveltyLeadingConstraint != null)
            {
                NoveltyLeadingConstraint.Dispose();
                NoveltyLeadingConstraint = null;
            }

            if (NoveltyList != null)
            {
                NoveltyList.Dispose();
                NoveltyList = null;
            }

            if (SelfView != null)
            {
                SelfView.Dispose();
                SelfView = null;
            }

            if (TapRecognizer != null)
            {
                TapRecognizer.Dispose();
                TapRecognizer = null;
            }
        }
Exemple #5
0
 public override void ViewWillDisappear(bool animated)
 {
     base.ViewWillDisappear(animated);
     SelfView.Stop();
 }