Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

AVCaptureFileOutputRecordingDelegate FinishedRecording is not calling when StopRecording() done

$
0
0

I have a method to record video in Xamarin Forms , in iOS it is not working sometimes. Below is my code if I continuously tapping the Start record. and Stop record buttons sometimes video is not recording.
public void RecordVideo()
{
try
{
if (movieFileOutput.Recording == false)
{
var outputUrl = ApplicationDocumentsDirectory().Append($"fundsApp{new NSUuid()}", false).AppendPathExtension("mov");
var _delegate = new OutputVideoRecorder();
movieFileOutput.StartRecordingToOutputFile(outputUrl, _delegate);

            }
            else
            {      try
                    {
                         movieFileOutput.StopRecording(); **_// At this point the breakpoint stops. sometimes ,where it is not calling                      the AVCaptureFileOutputRecordingDelegate FinishedRecording is not calling_**
                    }
                    catch (Exception ex)
                    {

                    }

}
}
catch (Exception ex)
{

        }

    }

public class OutputVideoRecorder : AVCaptureFileOutputRecordingDelegate
{

        public override void FinishedRecording(AVCaptureFileOutput captureOutput, NSUrl outputFileUrl, NSObject[] connections, NSError error)
        {
            MainThread.BeginInvokeOnMainThread(() =>
            {

                //Sending this to server

            });

        }
    }

Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>