Suspend and resume

Making sure the app suspends and resumes correctly is not only a certification requirement for your app but is also essential to ensure a good experience of your user.

When your app is suspended, the recording session should be stopped and then optionally restarted when the app resumes. Specifically, upon suspension you should:
  1. Create a deferral
  2. Call CaptureSession.StopAsync() (if recording)
  3. Call MediaCapture.StopPreviewAsync() (if previewing)
  4. Call MediaCapture.Dispose()
  5. Release the deferral
When resuming, you should initialize everything the same way it was done the first time the user ran the app.

In Windows Phone apps, you can use the standard Application.Current.Suspending & Application.Current.Resuming events to receive notification when your app is suspending and resuming.

In Windows store apps, you are given a 30 second grace period where the recording session will continue when you switch to the Windows start screen. Due to this difference you should not use the Suspending and Resuming events but instead use SystemMediaTransportControls.PropertyChanged and watch for the SoundLevel property changed from Muted (when suspending) to unmuted (when resuming).

Please refer to the remarks in the MediaCapture documentation for more information on the recommended way to handle suspend and resume when using MediaCapture.

Last edited Aug 20, 2014 at 9:58 PM by timgreenfield, version 2