Skip to content

Commit

Permalink
Added mic permissions to project
Browse files Browse the repository at this point in the history
  • Loading branch information
theangelperalta committed Oct 26, 2016
1 parent 7d46c96 commit a406a17
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,29 @@ open class TGCameraNavigationController: UINavigationController {
let navigationController: TGCameraNavigationController = TGCameraNavigationController()
navigationController.isNavigationBarHidden = true
//if navigationController != nil {
let status: AVAuthorizationStatus = AVCaptureDevice.authorizationStatus(forMediaType: AVMediaTypeVideo)
switch status {
let cameraStatus: AVAuthorizationStatus = AVCaptureDevice.authorizationStatus(forMediaType: AVMediaTypeVideo)
let micStatus: AVAuthorizationStatus = AVCaptureDevice.authorizationStatus(forMediaType: AVMediaTypeAudio)
/*switch status {
case .authorized:
navigationController.setupAuthorizedWithDelegate(delegate)
case .restricted, .denied:
navigationController.setupDenied()
case .notDetermined:
navigationController.setupNotDeterminedWithDelegate(delegate)
}
}*/

if cameraStatus == .authorized && micStatus == .authorized
{
navigationController.setupAuthorizedWithDelegate(delegate)
}
else if cameraStatus == .restricted || cameraStatus == .denied && micStatus == .restricted || micStatus == .denied
{
navigationController.setupDenied()
}
else
{
navigationController.setupNotDeterminedWithDelegate(delegate)
}
// }
return navigationController

Expand Down
2 changes: 2 additions & 0 deletions TGCameraViewController/Classes/Helper/TGCamera.swift
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ open class TGCamera: NSObject, AVCaptureFileOutputRecordingDelegate{
self.session.automaticallyConfiguresApplicationAudioSession = false
self.session.usesApplicationAudioSession = true


//
// setup device
//
Expand All @@ -190,6 +191,7 @@ open class TGCamera: NSObject, AVCaptureFileOutputRecordingDelegate{
}
device.exposureMode = .continuousAutoExposure


if TGCamera.minDuration != CMTimeMake(0, 0)
{
device.activeVideoMinFrameDuration = TGCamera.minDuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
Copyright (c) 2015 Tudo Gostoso Internet. All rights reserved.
*/

"TGCameraViewController-Title" = "Take photos";
"TGCameraViewController-Title" = "Take photos and video";
"TGCameraViewController-Subtitle" = "Allow access to your camera to start taking pictures with app";
"TGCameraViewController-Step1" = "1. Open the Settings of your device";
"TGCameraViewController-Step2" = "2. Go to Privacy";
"TGCameraViewController-Step3" = "3. Go the Camera";
"TGCameraViewController-Step4" = "4. Activate";
"TGCameraViewController-Step3" = "3. Go to Camera and Activate";
"TGCameraViewController-Step4" = "4. Go to Microphone and Activate";

0 comments on commit a406a17

Please sign in to comment.