Explore the integration of media technologies within your app. Discuss working with audio, video, camera, and other media functionalities.

All subtopics

Post

Replies

Boosts

Views

Activity

MPRemoteCommandCenter stops UIKeyCommand from working for a few seconds
Hello, We are seeing some strange behaviour when using MPRemoteCommandCenter as well as UIKeyCommand in our app on iOS 17. We are finding that when a UIKeyCommand is trigerred via external keyboard to start playing some music (via our own custom CoreAudio driver), the keyboard becomes unresponsive for a few seconds before UIKeyCommands are triggered again. Strangely enough, if we comment out all our MPRemoteCommandCenter code, the UIKeyCommands work without going into the unresponsive state for a few seconds. ie UIKeyCommands: override open var keyCommands: [UIKeyCommand] { let commands = [UIKeyCommand(title: String(localized: "__PLAY_STOP__"), action: #selector(shortcutPlayStop(_:)), input: " "), UIKeyCommand(title: String(localized: "__PAUSE__"), action: #selector(shortcutPause(_:)), input: "."), /** etc **/] commands.forEach { $0.wantsPriorityOverSystemBehavior = true } return commands } and MPRemoteCommands: MPRemoteCommandCenter.shared().playCommand.addTarget { [weak self] _ in self?.doStuff() // etc return .success } Note this issue did not occur prior to iOS17 🤨 Any ideas what could be going on? Thank you!
0
0
48
6d
Event callback issues with MediaSession API and iOS
Hi, I'm working on a web project that uses the MediaSession API to interface with the media notification on iOS. The issue that I'm experiencing occurs after pressing the play button in the media session modal where the session seems to NOT fire the event handler callback and also kill the media session itself. It's a strange behaviour considering that the pause callback works fine. audio_source = new Audio(url); navigator.mediasession.metadata = { ... // Metadata here }; navigator.mediasession.setActionHandler('play', (details) => { audio_source.play(); } ); navigator.mediasession.setActionHandler('pause', (details) => { audio_source.pause(); } );
1
0
61
6d
Problem with the phone's microphone
Hello, I'm having a problem with my Iphone 12: iOS version: 17.5.1 Model name: Iphone 12 When I call someone it's impossible to communicate, it seems that the microphone is deactivated or that it doesn't respond. I was able to extract the ips file from the "data": stacks+audiomxd-.... Here's an extract: {"bug_type":"288","timestamp":"2024-06-16 22:44:25.00 +0200","os_version":"iPhone OS 17.5.1 (21F90)","roots_installed":0,"incident_id":"7B8604DF-3863-4760-806C-591A90A7A7A4"} { "crashReporterKey" : "6928f591dd9e4d26541855e6d4b6a20d408bdfd1", "exception" : "0xbe18d1ee", "frontmostPids" : [ 34 ], "tuning" : { }, "absoluteTime" : 2954071508880, "product" : "iPhone13,2", "kernel" : "Darwin Kernel Version 23.5.0: Wed May 1 20:35:15 PDT 2024; root:xnu-10063.122.3~3\/RELEASE_ARM64_T8101", "date" : "2024-06-16 22:44:25.08 +0200", "reason" : "XPC message timeout in -[AVAudioSessionRemoteXPCClient getProperty:propertyName:MXProperty:reply:], probably deadlocked. Writing a stackshot and terminating.", "codeSigningMonitor" : 1, "incident" : "7B8604DF-3863-4760-806C-591A90A7A7A4", "build" : "iPhone OS 17.5.1 (21F90)", "roots_installed" : 0, "bug_type" : "288", "pid" : 102, "memoryStatus" : {"compressorSize":38088,"compressions":25391066,"decompressions":20835948,"busyBufferCount":3,"memoryPressureDetails":{"pagesWanted":467,"pagesReclaimed":2085},"pageSize":16384,"memoryPressure":false,"memoryPages":{"active":67555,"throttled":0,"fileBacked":60679,"wired":57187,"purgeable":3679,"inactive":65541,"free":1533,"speculative":2364}}, As you can see, one line states : "reason" : "XPC message timeout in -[AVAudioSessionRemoteXPCClient getProperty:propertyName:MXProperty:reply:], probably deadlocked. Writing a stackshot and terminating.", Deadlock occurs when two or more processes are waiting for resources held by the others, creating a situation where none of the processes can progress. In this case, it seems that the process has tried to recover an audio property, but has remained blocked indefinitely. What reinforces my doubts is that at the end of the .ips is a line that seems to give some informations as to where the problem is : "notes" : ["Requested by audiomxd","_dyld_process_info_create(623) for resampling UUIDs failed with 1","_dyld_process_info_create(2535) for resampling UUIDs failed with 1","_dyld_process_info_create(3181) for resampling UUIDs failed with 1","_dyld_process_info_create(3183) for resampling UUIDs failed with 1","_dyld_process_info_create(3503) for resampling UUIDs failed with 1","resampled 409 of 1813 threads with truncated backtraces from 0 pids: ","resampled 625 of 37 images missing from 175 pids: 75,93,98,178,190,210,...,3627"], Here's what my research yielded. Could you please help me? All calls are useless because the microphone no longer works. Regards
0
0
110
6d
RPBroadcastSampleHandler crashes while processing payload
We have an app with a broadcast extension with a RPBroadcastSampleHandler. The implementation is working fine, however for quite some users the extension suddenly crashes during the broadcast. The stacktrace stacktrace of the crashing thread always looks like the shortened sample below. (Full crash reports and stack traces are attached to the submitted Feedbacks.) Looking at the stacktrace none of our code is running, just ReplayKit code handling XPC messages at that moment: Thread: #0 0x00000001e2cf342c in __pthread_kill () #1 0x00000001f6a51c0c in pthread_kill () #2 0x00000001a1bfaba0 in abort () #3 0x00000001a9e38588 in malloc_vreport () #4 0x00000001a9e35430 in malloc_zone_error () [...] #18 0x0000000218ac91bc in -[RPBroadcastSampleHandler processPayload:completion:] () #19 0x0000000198b81360 in __NSXPCCONNECTION_IS_CALLING_OUT_TO_EXPORTED_OBJECT_S2__ () Is anyone aware of there issues with ReplayKit? Are there known workarounds? Could anything we're doing affect crashes like this? Would greatly appreciate it if anyone from Apple DTS could look into this and flag the below Feedbacks to the relevant teams! Feedback IDs: FB13949098, FB13949188
0
0
113
1w
AirDrop Requesting to Open Video via 3rd Party App Instead of Photo Library
I film and edit content using my iPhone and PremierePro. I've been doing this since 2017, so I'd like to say I know my way around an iPhone and the PremierePro software enough to get a finished product to my client. Before I send content to clients, I airdrop it to my phone to make sure that the quality of it is up to par. On this most recent project, I've had issues airdropping it to myself. Each time I do so, my iPhone prompts which 3rd party app I would like to open the video in, rather than automatically opening or saving the video into my photo library. I will list the specs below: Filmed on iPhone 15 Plus iOS Version 17.5.1 (at the moment this is the most up to date software update) Filmed in 4K at 60 FPS I have ample storage space on my phone and the video file size is 220MB Premiere Pro Export Settings: Video Settings - H.264, Field Order: Progressive, Bit Rate Encoding: CBR I will say that I purchased a transition and burns bundle and used it for the first time on this project. All materials used are in an .mp4 format and blend mode was set to overlay. Nothing out of pocket. I figured it wouldn't be a problem since my client would just be downloading it via dropbox, but there was an issue there as well. My client received an error message saying, "Sorry, this type of video cannot be saved to this device". The back road workaround was to take the saved video, plug it into a separate PremierePro project, and export it with the preset: Match Source - Adaptive High Bitrate. I was able to airdrop it to myself, it saved in my photo album and my client was able to download it without receiving that error message. If there is an explanation as to why I am having this issue and how I can avoid it, I would really appreciate it as I have never had this problem in the past.
0
0
116
1w
Reducing storage of similar PNGs by compressing them into a video and retrieving them losslessly--possibility or dumb idea?
My app stores and transports lots of groups of similar PNGs. These aren't compressed well by official algorithms like .lzfse, .lz4, .lzbitmap... not even bz2, but I realized that they are well-suited for compression by video codecs since they're highly similar to one another. I ran an experiment where I compressed a dozen images into an HEVCWithAlpha .mov via AVAssetWriter, and the compression ratio was fantastic, but when I retrieved the PNGs via AVAssetImageGenerator there were lots of artifacts which simply wasn't acceptable. Maybe I'm doing something wrong, or maybe I'm chasing something that doesn't exist. Is there a way to use video compression like a specialized archive to store and retrieve PNGs losslessly while retaining alpha? I have no intention of using the videos except as condensed storage. Any suggestions on how to reduce storage size of many large PNGs are also welcome. I also tried using HEVC instead of PNG via the new UIImage.hevcData(), but the decompression/processing times were just insane (5000%+ increase), on top of there being fatal errors when using async.
18
0
288
1w
GroupSessionJournal attachment loading error
Hello, currently working on a shareplay feature that allows users to pull 3d models from icloud and view it via volumes/immersive space on the vision pro. Was able to get the sharing working with multiple windows recently so now all that's left is to be able to sync/share the model in the SharePlay session. As I understand it, we should generally use GroupSessionMessenger for commands and light data like model positioning/syncing properties. Whereas for bigger pieces of data (images/videos/models), we should send these through GroupSessionJournal which the group session manages and syncs it for all users in the call. I have a button to get the current user's model data and add it to the journal via /// modelData is type `Data` try await journal.add(modelData) I have also set up a task to observe/receive updates to the journal's attachments in when receiving a group session. for await groupSession in MyModelActivity.sessions() { ... tasks.insert { Task { for await attachments in journal.attachments { for attachment in attachments { do { let modelData = try await attachment.load(Data.self) // throws error here - `notSupported` let modelUrl = writeModelDataToTempDirectory(modelData: modelData) self.modelUrlToLoadForGroupSession = modelUrl } catch let error { print("Error: \(error)") } } } } } } Not quite sure why I'm running into an error being thrown when attempting to load the attachment data on the other devices, any thoughts? The documentation for add(_:) and load(_:) say that the attachment should conform to Transferable but Data.Type should already conform to Transferable
1
0
176
1w
How to setup SharePlay reliably?
Hi, I’m developing an app that uses SharePlay. In specific, I’m using ShareLink in my SwiftUI-based app so that when 2 devices come close, it will start SharePlay via AirDrop, just like how Name Drop works (the animation is super cool, btw). However, I’ve notice that SharePlay doesn’t start reliably under the following conditions: Do both devices need to be signed in using different Apple ID? I wish it works with the same Apple ID. When both devices are running my app, the sharing does not seem to start; maybe both of them are trying to be the host app? When I try to demo this NameDrop-like transaction via Zoom, it usually doesn’t work; maybe because the cable is connected in Lightening port? Is some Mac app (in my case, Zoom or even QuickTime) capturing the screen of the device make it less likely to have successful SharePlay transaction? Thanks!
0
0
96
1w
Low Latency streaming via CDN
Hello gents, we have a problem serving LL HLS streams via CDN. Im kind of desperate what is wrong as stream plays correctly without CDN. The error thrown is: .invalidStream: Error Domain=CoreMediaErrorDomain Code=-15416 "Blocking Playlist Reload failed" (See -[AVPlayerItem errorLog] for 6 events) UserInfo={NSDescription=Blocking Playlist Reload failed, NSDebugDescription=See -[AVPlayerItem errorLog] for 6 events} errorLog: <AVPlayerItemErrorLog: 0x30174d5a0> when i check in manifest we have this enabled: #EXT-X-SERVER-CONTROL:CAN-BLOCK-RELOAD=YES,HOLD-BACK=6.000,PART-HOLD-BACK=4.000 what i do not understand is what this feature does or if CDN can somehow impact this feature. Any help is appreciated. Thanks!
0
0
154
1w
Stopped playing hls+fairplay, but was played yesterday
device iPhone 13 Pro max AVPlayer recieve error #Version: 1.0 #Software: AppleCoreMedia/1.0.0.21E236 (iPhone; U; CPU OS 17_4_1 like Mac OS X; en_us) #Date: 2024/06/11 14:06:18.018 CoreMediaErrorDomain error -42716 On system log we see propertyKey:IsLeaseExpired стандартное 14:38:28.008912+0300 mediaplaybackd <<<< FigCPECryptorPKD >>>> FigPKDCPECryptorSetKeyRequestResponse: 0xcc4160140 612C5D12-F92F-4897-B55D-854F842B41B4 keyResponseOptions:[] keyRequestResponse:0xcc5759d70 err:-42716 стандартное 14:38:28.009052+0300 mediaplaybackd keyboss ckb_transitionRequestToTerminalState: 0xcc5440380 <private> reqFin err <private> (-42716) dokeyCallbacksExist 0 стандартное 14:38:28.009138+0300 mediaplaybackd keyboss ckb_customURLReadCallback: 0xcc5440380 <private> customURLReqID 8 isComplete 1 err 0 error <private> (0) dokeyCallbacksExist 0 стандартное 14:38:28.009169+0300 mediaplaybackd <<<< FigPKDKeyManager >>>> keyManager_copyPropertyForEntryInternal: 0xcc546b280 6143FF61-5E6F-4506-A17D-4DB6B6BA0C5B propertyKey:IsLeaseExpired propertyValue: 0x16e5b17a0 стандартное 14:38:28.009196+0300 mediaplaybackd <<<< FigPKDKeyManager >>>> PKDKeyManagerSetKeyRequestError: keyManager:0xcc546b280 keyID:6143FF61-5E6F-4506-A17D-4DB6B6BA0C5B error:<private> (-19160) err:0 on server leaseDuration always is 0 But we have another device iPhone 15 Pro max, iOS 17.5.1 and he played correctly with the same crypt key from server
0
0
92
1w
ICDeviceBrowser fails to find any devices after iOS 18 update
I have an app that uses the ImageCaptureCore's ICDeviceBrowser to find and connect to external digital cameras. Prior to iOS 18 this worked just fine, the device browser would start up and find any cameras connected via USB. However since the update the device browser fails to ever detect any connected device or to trigger any delegate events at all after browser start. I noticed that the Contents authorization in iOS 18 is undetermined, where in previous iOS versions it would default to authorized. I tried to resolve this by requesting authorization, however this immediately returns denied without ever having prompted the app user for permission. I do have the Camera Privacy Usage description setup, and also am able to request permission for the iOS camera successfully. How can I successfully request contents authorization via ICC or otherwise? Or are there alternative Apple libraries I can use for finding and connecting to external digital cameras on iOS?
0
0
132
1w
LockedCameraCapture - Access to App Group User Defaults in a lock screen camera extension
From what I understood from watching the session LockedCameraCapture, the extension doesn't have access to the App Group User Defaults, so I'm wondering how I can synchronize preferences between the extension and the main app. From what I can see, the builtin iOS Camera app is able to synchronize its preferences. For example, the "Live Photo" mode toggle state is preserved whether in the main app or in the lock screen. Is there anything I'm not aware of?
2
0
192
1w
iOS 18 third party audio glitch
Hi there, whenever I use any third party editing software, the third clip and clips after that have no audio. Here’s how I did it take any third party editing software put 2 clips, cut one in half and delete the other half, cut a half of the 2nd clip Any fixes?
3
0
162
1w
Add 30 frames per secons in assetWriter
Hello, I have converted UIImage to CVPixelBuffer. I am creating a video writing app. In some cases, the same CVPixelBuffer should last in the video for 2 seconds or more. However, I need to add 30 CVPixelBuffers per second because the video, to work on social media, must be 30 frames per second. The problem is that whenever I try to add frames to long videos, like 50-minute videos, it gives an error. The error is something like "Operation cannot be completed". Give me an example of a loop to add 30 CVPixelBuffers per second to a currently written video. Example: while true { if videoInput.isReadyForMoreMediaData { break } if videoInput.isReadyForMoreMediaData, let buffer = videoProvider.getNextFrame() { adaptor.append(buffer, withPresentationTime: CMTime(value: 1, timescale: 30)) } } I await your response.
0
0
147
1w