mirror of
https://github.com/samsonjs/SwiftyCam.git
synced 2026-04-14 12:26:04 +00:00
Updating device input adding
This commit is contained in:
parent
257c889761
commit
d2573502b7
3 changed files with 9 additions and 9 deletions
Binary file not shown.
|
|
@ -192,20 +192,21 @@ open class SwiftyCamViewController: UIViewController {
|
|||
case .rear:
|
||||
self.currentCamera = .front
|
||||
}
|
||||
|
||||
self.session.stopRunning()
|
||||
|
||||
sessionQueue.async { [unowned self] in
|
||||
let currentInputs : [AVCaptureInput] = self.session.inputs as! [AVCaptureInput]
|
||||
let currentOutputs : [AVCaptureOutput] = self.session.outputs as! [AVCaptureOutput]
|
||||
|
||||
for input in currentInputs {
|
||||
self.session.removeInput(input)
|
||||
|
||||
for input in self.session.inputs {
|
||||
self.session.removeInput(input as! AVCaptureInput)
|
||||
}
|
||||
for output in currentOutputs {
|
||||
self.session.removeOutput(output)
|
||||
for output in self.session.outputs {
|
||||
self.session.removeOutput(output as! AVCaptureOutput)
|
||||
}
|
||||
|
||||
self.configureSession()
|
||||
self.cameraDelegate?.SwiftyCamDidSwitchCameras(camera: self.currentCamera)
|
||||
self.session.startRunning()
|
||||
}
|
||||
disableFlash()
|
||||
}
|
||||
|
|
@ -356,7 +357,6 @@ open class SwiftyCamViewController: UIViewController {
|
|||
if self.session.canAddOutput(movieFileOutput) {
|
||||
self.session.addOutput(movieFileOutput)
|
||||
self.session.sessionPreset = videoInputPresetFromVideoQuality(quality: videoQuality)
|
||||
print(videoInputPresetFromVideoQuality(quality: videoQuality))
|
||||
if let connection = movieFileOutput.connection(withMediaType: AVMediaTypeVideo) {
|
||||
if connection.isVideoStabilizationSupported {
|
||||
connection.preferredVideoStabilizationMode = .auto
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'SwiftyCam'
|
||||
s.version = '1.0.0'
|
||||
s.version = '1.0.1'
|
||||
s.summary = 'A Simple, Snapchat-style camera Framework written in Swift'
|
||||
s.ios.deployment_target = '8.0'
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue