From ddc65ba73d9763f68f7dcc7dd702763e5d39e28b Mon Sep 17 00:00:00 2001 From: Morgan Pretty Date: Wed, 21 Dec 2022 18:02:57 +1100 Subject: [PATCH] Set the max size for recording videos --- Session/Media Viewing & Editing/PhotoCapture.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Session/Media Viewing & Editing/PhotoCapture.swift b/Session/Media Viewing & Editing/PhotoCapture.swift index 41ec6bb30..50720f6f6 100644 --- a/Session/Media Viewing & Editing/PhotoCapture.swift +++ b/Session/Media Viewing & Editing/PhotoCapture.swift @@ -6,6 +6,7 @@ import Foundation import AVFoundation import PromiseKit import CoreServices +import SessionMessagingKit protocol PhotoCaptureDelegate: AnyObject { func photoCapture(_ photoCapture: PhotoCapture, didFinishProcessingAttachment attachment: SignalAttachment) @@ -463,6 +464,9 @@ class CaptureOutput { // leaving it enabled causes all audio to be lost on videos longer // than the default length (10s). movieOutput.movieFragmentInterval = CMTime.invalid + + // Ensure the recorded movie can't go over the maximum file server size + movieOutput.maxRecordedFileSize = Int64(FileServerAPI.maxFileSize) } var photoOutput: AVCaptureOutput? {