Closed joshoconnor89 closed 7 years ago
Seems like the issue was I had set the AVAudioSession to Ambient or Playback elsewhere, and this audiosession was causing video to not load. Here is an example of the code I updated (isCaptureMode will be true if we are using the camera)
` do { if (!isCaptureMode){ try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryAmbient) }
}
catch {
// report for an error
}
`
I am using the method "switchCameraButtonPressed" below, which switches the capture device from front -> back, or vice versa. When this method is ran, the entire screen overlays with a dark background, and freezes. I cant switch the camera back again. I'm not sure what is causing this issue. Does anyone else experiencing this freezing?
` @IBAction func switchCameraButtonPressed(sender: AnyObject) {