NewCameraOutputMode not passed during init bug fixed.
This commit is contained in:
parent
5ded48c44c
commit
8a818c1b96
Binary file not shown.
|
|
@ -206,7 +206,7 @@ public class CameraManager: NSObject, AVCaptureFileOutputRecordingDelegate {
|
|||
return addPreviewLayerToView(view, newCameraOutputMode: cameraOutputMode)
|
||||
}
|
||||
public func addPreviewLayerToView(view: UIView, newCameraOutputMode: CameraOutputMode) -> CameraState {
|
||||
return addPreviewLayerToView(view, newCameraOutputMode: cameraOutputMode, completition: nil)
|
||||
return addPreviewLayerToView(view, newCameraOutputMode: newCameraOutputMode, completition: nil)
|
||||
}
|
||||
public func addPreviewLayerToView(view: UIView, newCameraOutputMode: CameraOutputMode, completition: (Void -> Void)?) -> CameraState {
|
||||
if _canLoadCamera() {
|
||||
|
|
@ -476,7 +476,8 @@ public class CameraManager: NSObject, AVCaptureFileOutputRecordingDelegate {
|
|||
|
||||
if shouldReinitializeMovieOutput {
|
||||
movieOutput = AVCaptureMovieFileOutput()
|
||||
|
||||
// movieOutput?.movieFragmentInterval = kCMTimeInvalid
|
||||
|
||||
captureSession?.beginConfiguration()
|
||||
captureSession?.addOutput(movieOutput)
|
||||
captureSession?.commitConfiguration()
|
||||
|
|
|
|||
|
|
@ -68,20 +68,12 @@ class ViewController: UIViewController {
|
|||
private func addCameraToView()
|
||||
{
|
||||
cameraManager.addPreviewLayerToView(cameraView, newCameraOutputMode: CameraOutputMode.VideoWithMic)
|
||||
cameraManager.showErrorBlock = { (erTitle: String, erMessage: String) -> Void in
|
||||
cameraManager.showErrorBlock = { [weak self] (erTitle: String, erMessage: String) -> Void in
|
||||
|
||||
let alertController = UIAlertController(title: erTitle, message: erMessage, preferredStyle: .Alert)
|
||||
alertController.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: { (alertAction) -> Void in }))
|
||||
|
||||
// var alertController = UIAlertController(title: erTitle, message: erMessage, preferredStyle: .Alert)
|
||||
// alertController.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: { (alertAction) -> Void in
|
||||
// //
|
||||
// }))
|
||||
//
|
||||
// let topController = UIApplication.sharedApplication().keyWindow?.rootViewController
|
||||
//
|
||||
// if (topController != nil) {
|
||||
// topController?.presentViewController(alertController, animated: true, completion: { () -> Void in
|
||||
// //
|
||||
// })
|
||||
// }
|
||||
self?.presentViewController(alertController, animated: true, completion: nil)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue