iPhone Screen recording failed to save due to -5825

Viewed 1888

I've video streaming in my app. I'm having some weird issues in screen recording on iPhone. The most obvious issue is that during live streaming screen recording iPhone fails to save recorded screen with error 5825.

Another issue is that audio stops in my app when screen recording is started. I can screen record other apps such as YouTube etc.

Somewhere it's suggested that it's due to lack of storage. I've enough storage space on my devices. I've tried different iPhones and I can see same issue on all.

So I was wondering if I need any special permissions or any handling in my app to allow screen recording?

Is it really any issue with my app (code) or it's purely device issue?

1 Answers

Have you tried to set AVAudioSession category to .multiRoute or .playAndRecord?

do {
    let session = AVAudioSession.sharedInstance()
    try session.setCategory(.multiRoute)
    try session.setMode(.default /* or .moviePlayback*/)
    try session.setActive(true, options: options)
} catch {
    print("ActiveAudioSession failed.")
}

I have the same issue but can't always reproduce it, so my next try is to add this lines of code.

Another thing I found here - https://discussions.apple.com/thread/251342404

which says:

That usually appears when there is a space issue. Do you have ample free space on the iPhone? How long of a screen recording was it? Did you attempt to record any copyrighted materials?

UPDATE seems to be it could be also a bug in iOS 14+

Related