Post

Replies

Boosts

Views

Activity

Reply to In RPBroadcastSampleHandler not called `processSampleBuffer`
I found out that RPBroadcastSampleHandler does not have a problem directly with CallKit. The problem is that I use AVSampleBufferDisplayLayer to display during a video call. My problem is that if I use AVSampleBufferDisplayLayer.preventsCapture = true, the RPBroadcastSampleHandler extension does not start. I expected from the preventsCapture setting that only that part of the image would not be recorded.  Is it possible to keep this setting while still allowing screen recording to work?
Topic: Media Technologies SubTopic: General Tags:
Mar ’23
Reply to import pdf from url
Try this for download iCloudFile: url.startAccessingSecurityScopedResource() if !FileManager.default.fileExists(atPath: url.path), FileManager.default.isUbiquitousItem(at: url) {                 try FileManager.default.startDownloadingUbiquitousItem(at: url)                 startReadingStatus(for: url) { isSuccess in                     if isSuccess {                         do {                             try FileManager.default.copyItem(at: url, to: LOCAL_URL)                         } catch {                             print(error)                         }                     }                     url.stopAccessingSecurityScopedResource()                 }                 return true             }     internal func startReadingStatus(for url: URL, completion: ((Bool) -> Void)? = nil) {         DispatchQueue.main.async {             Timer.scheduledTimer(withTimeInterval: 0.5, repeats: true, block: { [weak self] (timer) in                 guard let status = self?.downloadStatus(for: url)                 else {                     completion?(false)                     return                 }                 if status == URLUbiquitousItemDownloadingStatus.current {                     timer.invalidate()                     completion?(true)                 }             })         }     }          internal func downloadStatus(for url: URL) -> URLUbiquitousItemDownloadingStatus? {         do {             let attributes = try url.resourceValues(forKeys: [URLResourceKey.ubiquitousItemDownloadingStatusKey])             guard let status: URLUbiquitousItemDownloadingStatus = attributes.allValues[URLResourceKey.ubiquitousItemDownloadingStatusKey] as? URLUbiquitousItemDownloadingStatus             else {                 return nil             }             return status         } catch {             return nil         }     }
Feb ’23