void SessionRuntimeError (NSNotification notification)
{
var error = (NSError)notification.UserInfo [AVCaptureSession.ErrorKey];
Console.WriteLine ($"Capture session runtime error: {error}");
if (error.Code == (long)AVError.MediaServicesWereReset) {
sessionQueue.DispatchAsync (() => {
// If we aren't trying to resume the session, try to restart it, since it must have been stopped due to an error (see -[resumeInterruptedSession:])
if (sessionRunning) {
Session.StartRunning ();
sessionRunning = Session.Running;
} else {
DispatchQueue.MainQueue.DispatchAsync (() => {
ResumeButton.Hidden = false;
});
}
});
} else {
ResumeButton.Hidden = false;
}
}