Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ios/DualCameraPreview.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ import CoreLocation
}

if let sessionManager = self.sessionManager,
sessionManager.isReady() {
sessionManager.isReady() {
sessionManager.stopSession()
sessionManager.videoMixer.unlockOrientation()
}

DispatchQueue.main.async {
NotificationCenter.default.removeObserver(self, name: UIDevice.orientationDidChangeNotification, object: nil)

DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
DispatchQueue.main.asyncAfter(deadline: .now()) {
self.previewBuilder?.teardownPreview()
self.sessionManager = nil
self.previewBuilder = nil
Expand Down
1 change: 0 additions & 1 deletion src/ios/VideoMixer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ class VideoMixer {
if let pixelBuffer = pixelBuffer {
pixelBuffers.append(pixelBuffer)
}
pixelBuffer = nil
}
pixelBuffers.removeAll()
}
Expand Down
10 changes: 5 additions & 5 deletions src/ios/VideoRecorder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ class VideoRecorder {
}
}

print("VideoRecorder: Writer initialized at \(self.outputURL!.path)")
writer.startWriting()
self.isWriting = true
self.startTime = nil
self.completionHandler = nil

DispatchQueue.main.async {
Expand All @@ -119,12 +120,11 @@ class VideoRecorder {

guard self.isWriting,
let writer = self.assetWriter,
writer.status == .unknown || writer.status == .writing,
writer.status == .writing,
let vInput = self.videoInput,
let adaptor = self.adaptor else { return }

if writer.status == .unknown {
writer.startWriting()
if self.startTime == nil {
writer.startSession(atSourceTime: presentationTime)
self.startTime = presentationTime
}
Expand Down Expand Up @@ -235,4 +235,4 @@ class VideoRecorder {
_isWriting = newValue
}
}
}
}
Loading