Ejemplo n.º 1
0
        private async void RecordVideo()
        {
            IsRecordingVideo = true;
            for (var i = 3; i >= 0; --i)
            {
                Counter = i;
                await Task.Delay(TimeSpan.FromSeconds(1));
            }
            try
            {
                _imageProcessor.StartRecordVideo();
                //записываем видео продолжительностью 5 секунд
                _timerStop.Interval = TimeSpan.FromSeconds(5);
                _timerStop.Tick    += StopRecord;

                _timerStop.Start();
            }
            catch (Exception ex)
            {
                _imageProcessor.StopRecordVideo(true);
                CloseSession();
                OpenSession();
                StartLiveView();
                IsRecordingVideo = false;
                TakeVideoCommand.CanExecute(null);
                LabelTakeVideo = "Oops, an error please try again";
            }
        }