mirror of
https://github.com/samsonjs/SwiftyCam.git
synced 2026-04-24 14:37:45 +00:00
Addouble tap tap to switch camera
This commit is contained in:
parent
9f9a8a0e17
commit
dbf46f720e
4 changed files with 12 additions and 3 deletions
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
## Version 1.5.0
|
## Version 1.5.0
|
||||||
- Added support for front-facing camera tap to adjust exposure
|
- Added support for front-facing camera tap to adjust exposure
|
||||||
|
- Added support for double tap gesture to switch cameras
|
||||||
|
- Added doubleTapCameraSwitch property
|
||||||
- Updated demo application with tap animation
|
- Updated demo application with tap animation
|
||||||
|
|
||||||
## Version 1.4.0
|
## Version 1.4.0
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ class ViewController: SwiftyCamViewController, SwiftyCamViewControllerDelegate {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
cameraDelegate = self
|
cameraDelegate = self
|
||||||
kMaximumVideoDuration = 10.0
|
kMaximumVideoDuration = 10.0
|
||||||
|
doubleTapCameraSwitch = true
|
||||||
addButtons()
|
addButtons()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -209,6 +209,12 @@ switchCamera()
|
||||||
|
|
||||||
Tap-to-focus, pinch-to-zoom and camera flash are not supported when the front facing camera is selected. *Switching video while video is being recorded is not currently supported*
|
Tap-to-focus, pinch-to-zoom and camera flash are not supported when the front facing camera is selected. *Switching video while video is being recorded is not currently supported*
|
||||||
|
|
||||||
|
SwiftyCam also enables switching between cameras with a double tap gesture. To disable this feature, use the `doubleTapCameraSwitch` property:
|
||||||
|
|
||||||
|
```swift
|
||||||
|
doubleTapCameraSwitch = false
|
||||||
|
```
|
||||||
|
|
||||||
##Configuration
|
##Configuration
|
||||||
|
|
||||||
SwiftyCam has several options for configurating the functionality of the capture:
|
SwiftyCam has several options for configurating the functionality of the capture:
|
||||||
|
|
|
||||||
|
|
@ -460,8 +460,8 @@ open class SwiftyCamViewController: UIViewController {
|
||||||
currentCamera = .front
|
currentCamera = .front
|
||||||
}
|
}
|
||||||
|
|
||||||
self.session.stopRunning()
|
session.stopRunning()
|
||||||
|
|
||||||
sessionQueue.async { [unowned self] in
|
sessionQueue.async { [unowned self] in
|
||||||
|
|
||||||
// remove and re-add inputs and outputs
|
// remove and re-add inputs and outputs
|
||||||
|
|
@ -539,7 +539,7 @@ open class SwiftyCamViewController: UIViewController {
|
||||||
}
|
}
|
||||||
|
|
||||||
if let device = videoDevice {
|
if let device = videoDevice {
|
||||||
do {
|
do {
|
||||||
try device.lockForConfiguration()
|
try device.lockForConfiguration()
|
||||||
if device.isFocusModeSupported(.continuousAutoFocus) {
|
if device.isFocusModeSupported(.continuousAutoFocus) {
|
||||||
device.focusMode = .continuousAutoFocus
|
device.focusMode = .continuousAutoFocus
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue