From 98993c63422502aad98697186f433a0d310003f4 Mon Sep 17 00:00:00 2001 From: blurtime Date: Sun, 3 Mar 2019 18:48:03 +0100 Subject: [PATCH] Change categroy of AVAudioSession Just a small suggestion: I found that the `.ambient` audio session category sometimes only played the video's audio at a much lower volume - in some cases, I couldn't hear anything at all. Therefore, I'd suggest changing it to `.playback` since that's the safer way to have audio. Really like the pod (and the examples), thank you! --- DemoSwiftyCam/DemoSwiftyCam/VideoViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DemoSwiftyCam/DemoSwiftyCam/VideoViewController.swift b/DemoSwiftyCam/DemoSwiftyCam/VideoViewController.swift index 8121d1a..e310978 100644 --- a/DemoSwiftyCam/DemoSwiftyCam/VideoViewController.swift +++ b/DemoSwiftyCam/DemoSwiftyCam/VideoViewController.swift @@ -63,7 +63,7 @@ class VideoViewController: UIViewController { // Allow background audio to continue to play do { if #available(iOS 10.0, *) { - try AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.ambient, mode: .default, options: []) + try AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.playback, mode: .default, options: []) } else { } } catch let error as NSError {