Ejemplo n.º 1
0
 public override void DidFinishCapture(AVCapturePhotoOutput captureOutput,
                                       AVCaptureResolvedPhotoSettings resolvedSettings,
                                       NSError error)
 {
     if (ShouldSaveCaptureResult(error))
     {
         PHAssetManager.PerformChangesWithAuthorization(TryToAddPhotoToLibrary, null, DidFinish);
     }
 }
Ejemplo n.º 2
0
        private void CleanUp(bool saveToAssets, NSUrl outputFileUrl)
        {
            if (_backgroundRecordingId != null)
            {
                if (_backgroundRecordingId != UIApplication.BackgroundTaskInvalid)
                {
                    UIApplication.SharedApplication.EndBackgroundTask(_backgroundRecordingId.Value);
                }

                _backgroundRecordingId = UIApplication.BackgroundTaskInvalid;
            }

            if (!saveToAssets)
            {
                DeleteFileIfNeeded(outputFileUrl);
                return;
            }

            PHAssetManager.PerformChangesWithAuthorization(() => SaveVideoToLibrary(outputFileUrl),
                                                           () => DeleteFileIfNeeded(outputFileUrl), null);
        }