Closed ethul closed 2 weeks ago
Guten Tag, Hans here! 🍻
Zis feature request for enabling multitasking camera access on iOS is interesting, and it looks like you already made some attempts! However, we need a bit more information to evaluate zis properly. It would be helpful if you could provide any logs or error messages you encountered while implementing zis feature.
Also, if you appreciate ze work we do on zis repository, consider sponsoring the project to help us keep it going! Support mrousavy on GitHub Sponsors.
Let's keep ze conversation going!
Note: If you think I made a mistake, please ping
@mrousavy
to take a look.
Without the change to enable multitasking, when Stage Manager or Split View/Slide Over was turned on, the camera preview was blank, and recording a video issued an error:
capture/unknown: Error Domain=AVFoundationErrorDomain Code=-11803 "Cannot Record" UserInfo={AVErrorRecordingFailureDomainKey=3, NSLocalizedDescription=Cannot Record, NSLocalizedRecoverySuggestion=Try recording again.}
Hey! Oh, pretty cool. Yea I can add that feature if I have some free time soon, thanks for posting the code here this is really helpful.
Great, thanks!
+1 on this, I have CameraRuntimeError
's every now and then when another task interrupts the camera. Not 100% sure if this would fix the problem, but it couldn't hurt! Sometimes, this also creates a video recording with no audio when another video in the background hijacks the audio session.
Reading the docs wouldn't hurt - this is already true
if you have the entitlement for it (which is required, and would crash otherwise)
I think it is important to note that the multitaasking-camera-access entitlement is deprecated.
It seems like the recommended approach is to use isMultitaskingCameraAccessEnabled
.
What feature or enhancement are you suggesting?
Would it be possible to add support for enabling multitasking camera access?
This would be useful for apps running on iPads with Stage Manager or Split View/Slide Over turned on.
From the Apple developer documentation I tried adding the following to the camera session, which seemed to do the trick.
What Platforms whould this feature/enhancement affect?
iOS
Alternatives/Workarounds
I manually made the change in
Core/CameraSession.swift
.Additional information