mirror of
https://github.com/samsonjs/SwiftyCam.git
synced 2026-04-27 15:07:43 +00:00
Added default camera functionality'
This commit is contained in:
parent
c2952e7833
commit
67ff337423
2 changed files with 11 additions and 2 deletions
|
|
@ -26,9 +26,7 @@ class ViewController: SwiftyCamViewController, SwiftyCamViewControllerDelegate {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
cameraDelegate = self
|
cameraDelegate = self
|
||||||
maximumVideoDuration = 10.0
|
maximumVideoDuration = 10.0
|
||||||
doubleTapCameraSwitch = true
|
|
||||||
addButtons()
|
addButtons()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override var prefersStatusBarHidden: Bool {
|
override var prefersStatusBarHidden: Bool {
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,11 @@ open class SwiftyCamViewController: UIViewController {
|
||||||
|
|
||||||
public var doubleTapCameraSwitch = true
|
public var doubleTapCameraSwitch = true
|
||||||
|
|
||||||
|
/// Set default launch camera
|
||||||
|
|
||||||
|
public var defaultCamera = CameraSelection.rear
|
||||||
|
|
||||||
|
|
||||||
// MARK: Public Get-only Variable Declarations
|
// MARK: Public Get-only Variable Declarations
|
||||||
|
|
||||||
/// Returns true if video is currently being recorded
|
/// Returns true if video is currently being recorded
|
||||||
|
|
@ -482,6 +486,13 @@ open class SwiftyCamViewController: UIViewController {
|
||||||
guard setupResult == .success else {
|
guard setupResult == .success else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set default camera
|
||||||
|
|
||||||
|
currentCamera = defaultCamera
|
||||||
|
|
||||||
|
// begin configuring session
|
||||||
|
|
||||||
session.beginConfiguration()
|
session.beginConfiguration()
|
||||||
configureVideoPreset()
|
configureVideoPreset()
|
||||||
addVideoInput()
|
addVideoInput()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue