mirror of
https://github.com/samsonjs/SwiftyCam.git
synced 2026-04-27 15:07:43 +00:00
Ensure preview layer is accessed on main thread
This commit is contained in:
parent
04faa034e3
commit
a9746bf861
1 changed files with 4 additions and 1 deletions
|
|
@ -504,6 +504,9 @@ open class SwiftyCamViewController: UIViewController {
|
|||
previewLayer.addSubview(flashView!)
|
||||
}
|
||||
|
||||
//Must be fetched before on main thread
|
||||
let previewOrientation = previewLayer.videoPreviewLayer.connection!.videoOrientation
|
||||
|
||||
sessionQueue.async { [unowned self] in
|
||||
if !movieFileOutput.isRecording {
|
||||
if UIDevice.current.isMultitaskingSupported {
|
||||
|
|
@ -519,7 +522,7 @@ open class SwiftyCamViewController: UIViewController {
|
|||
movieFileOutputConnection?.isVideoMirrored = true
|
||||
}
|
||||
|
||||
movieFileOutputConnection?.videoOrientation = self.orientation.getVideoOrientation() ?? self.previewLayer.videoPreviewLayer.connection!.videoOrientation
|
||||
movieFileOutputConnection?.videoOrientation = self.orientation.getVideoOrientation() ?? previewOrientation
|
||||
|
||||
// Start recording to a temporary file.
|
||||
let outputFileName = UUID().uuidString
|
||||
|
|
|
|||
Loading…
Reference in a new issue