I'm programming on Xamarin Forms and created a renderer to iOS. So after iOS 14 update, my app starts the recording but stops immediatly after. On iOS 13 the record runs perfectly.
Steps to face the problem on iOS 14:
- Camera preview is showed.
- The user clicks on start record button.
- The recording video status icon is shown on iPhone top bar (native)
- The capture is stopped immediatly
Steps on iOS 13:
- Camera preview is showed.
- The user clicks on the start record button.
- The recording video status icon is shown on iPhone top bar (native)
- The capture is stopped after 5 seconds (time limit that I set).
Below is the renderer code, that I'm using:
private void StartVideo(object sender, EventArgs e)
{
Element.completed = new TaskCompletionSource<VideoViewResult>();
NSUrl url = new NSUrl(PathFile, true);
if (avDel == null) avDel = new AVCaptureFileOutputRecording();
if (output == null) output = new AVCaptureMovieFileOutput();
var stillImageOutput = new AVCaptureStillImageOutput()
{
OutputSettings = new NSDictionary()
};
output.MaxRecordedDuration = CoreMedia.CMTime.FromSeconds(5, 1); // time limit
// output.MaxRecordedDuration = CoreMedia.CMTime.FromSeconds(50000, 1); //not working too
if (Control.CaptureSession.CanAddOutput(output)) Control.CaptureSession.AddOutput(output);
output.StartRecordingToOutputFile(url, avDel);
avDel.StopRecord += StopRecording;
}
I've analyzed the permissions, but kinda OK. Any ideas to solve this? Thanks.