Skip to content
Merged
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
8 changes: 2 additions & 6 deletions .github/DISCUSSION_TEMPLATE/bug-reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,11 @@ body:
attributes:
value: "# Bug Report"

- type: dropdown
- type: input
attributes:
label: Version
description: What version of BetterCapture are you running? You can find this in Settings > General.
options:
- v2026.1.3
- v2026.1.2
- v2026.1.1
- v2026.1.0
placeholder: "v2026.2"
validations:
required: true

Expand Down
2 changes: 1 addition & 1 deletion BetterCapture/View/MenuBarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ struct MenuBarView: View {
accentColor: .green,
isDisabled: !viewModel.canStartRecording
) {
dismiss()
Task {
await viewModel.startRecording()
dismiss()
}
}
.padding(.top, 8)
Expand Down
7 changes: 7 additions & 0 deletions BetterCapture/ViewModel/RecorderViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@ final class RecorderViewModel {
}
logger.info("Video size: \(self.videoSize.width)x\(self.videoSize.height)")

// Access security-scoped output directory before writing
settings.startAccessingOutputDirectory()

// Setup asset writer
let outputURL = settings.generateOutputURL()
try assetWriter.setup(url: outputURL, settings: settings, videoSize: videoSize)
Expand All @@ -247,6 +250,7 @@ final class RecorderViewModel {
lastError = error
cameraSession.stop()
selectionBorderFrame.dismiss()
settings.stopAccessingOutputDirectory()
logger.error("Failed to start recording: \(error.localizedDescription)")
}
}
Expand Down Expand Up @@ -279,10 +283,13 @@ final class RecorderViewModel {
// Send notification
notificationService.sendRecordingSavedNotification(fileURL: outputURL)

settings.stopAccessingOutputDirectory()

} catch {
state = .idle
lastError = error
assetWriter.cancel()
settings.stopAccessingOutputDirectory()
notificationService.sendRecordingFailedNotification(error: error)
logger.error("Failed to stop recording: \(error.localizedDescription)")
}
Expand Down
Loading