I am using CTVideoView to playback videos inside a UITableView in iOS. As of late this was working fine, but for some reason, it seems as though the something has gone astray.
About 10% of the videos will play in the table, but many will simply just fail to play. The error occurs when iOS is trying to download the video as can be seen by the error messages below. For some reason, the error message is different in iOS 10 & 11 but the code is the same.
Based on iOS 10's message one would believe that the network is not available, but if I point my safari/chrome browser on the same iOS device it plays the video just fine.
As for the iOS 11 message, I have no idea where to even start as it the first time I've seen this message.
Any help at all would be much appreciated in resolving this.
iOS 10 Error Message
FAILED TO PREPARE VIDEO WITH ERROR: Error Domain=NSURLErrorDomain
Code=-1 "unknown error" UserInfo={NSLocalizedDescription=unknown
error,
NSErrorFailingURLStringKey=URLOBSCUREDFORPRIVACY,
NSErrorFailingURLKey=URLOBSCUREDFORPRIVACY,
NSURL=URLOBSCUREDFORPRIVACY,
NSUnderlyingError=0x17044bd00 {Error Domain=CoreMediaErrorDomain
Code=-12939 "CFNetwork error unavailable"
UserInfo={NSDescription=CFNetwork error unavailable,
NSURL=URLOBSCUREDFORPRIVACY}}}
iOS 11 Error Message
FAILED TO PREPARE VIDEO WITH ERROR: Error Domain=NSURLErrorDomain
Code=-1 "unknown error" UserInfo={NSUnderlyingError=0x1c08483d0 {Error
Domain=CoreMediaErrorDomain Code=-12939 "content range mismatch -
should be start 0 length 1247166 is start 0 length 1048575"
UserInfo={NSDescription=content range mismatch - should be start 0
length 1247166 is start 0 length 1048575,
NSURL=URLOBSCUREDFORPRIVACY}},
NSErrorFailingURLStringKey=URLOBSCUREDFORPRIVACY,
NSErrorFailingURLKey=URLOBSCUREDFORPRIVACY,
NSURL=URLOBSCUREDFORPRIVACY,
NSLocalizedDescription=unknown error}
Update (Possible Clue)
So after some testing I've narrowed it down to videos longer than or equal to 10 seconds. In all other circumstances the video will play.
I have resolved the issue. The issue was with ParseServer and the fact that it could not stream videos to iOS as it does not come out of the box with byte-range headers configured.
The solution was to implement the GridStoreAdapter into the server and from there migrate file storage to S3 or GCS (depending on your preference). This will need to be done alongside the respective adapter for your service.
Once that was done, the app started behaving correctly again.
Related
My code has retries till success when uploading a file to S3. At the moment the retries are triggered from a different place in app and do not have backoff. This means within a few seconds we have multiple upload attempts and all of them fail with the same error. The upload eventually succeeds.
Full error:
Error Domain=NSCocoaErrorDomain Code=640
"You can’t save the file “<UUID-1>.tmp” because the volume “Data” is out of space."
UserInfo={
NSFilePath=/var/mobile/Containers/Data/Application/UUID-2/Library/Caches/S3TransferUtility/<UUID1>.tmp,
NSUnderlyingError=0x2831d7b40 {Error Domain=NSPOSIXErrorDomain Code=28 "No space left on device"}
}
I read online that this error was introduced in iOS 14. I am assuming S3TransferUtility creates multiple NSURL calls that could be causing this issue, since the user is on iOS 15.
Error Domain=NSPOSIXErrorDomain Code=28 “No space left on device” UserInfo={_kCFStreamErrorCodeKey=28, _kCFStreamErrorDomainKey=1}
It appears to get called when there are too many NSURLSessions created, reaching a limit of (in our tests) 600-700 sessions, which are not maintained or closed properly. The error started to get thrown since iOS 14, so it is interesting to see if there was a limit introduced.
Is the only way to get around this issue to add some delay on getting this error before retrying an upload? Or is there a way to manually clear the cache for S3TransferUtility and immediately retry?
While Implementing Offline FPS Getting AVFoundation Error -11800
I am implementing the Offline HLS using FPS.
I have downloaded the video using AVAssetDownloadDelegate
Now For DRM content I need to fetch license so I have implemented the AVAssetResourceLoaderDelegate
Everything is working fine in AVAssetResourceLoaderDelegate, I got the CKC or License but when I execute following code
let persistentContentKeyContext = try loadingRequest.persistentContentKey(fromKeyVendorResponse: responseData, options: nil)
I get following error
Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSLocalizedFailureReason=An unknown error occurred (-12158), NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x1c084a6e0 {Error Domain=NSOSStatusErrorDomain Code=-12158 "(null)"}}
Can anyone please tell me what does this error codes means and how to resolve this error.
Unfortunately, the error response you are seeing is not very informative as you have noticed and could cover multiple failure cases.
It is typically means that the device FairPlay service cannot properly decode the CKC that your DRM server provided to the device, or else that some of the information in it is not consistent with a persistent license.
This is a problem for you to debug as the CKC that is sent back is encrypted in a way that you will not be able to read - see diagram below from Apple showing the sequence:
The best way to debug and investigate this is usually to contact the provider of your DRM server (key server in the above diagram) and see if they can investigate it on the server side and decode the response they are sending to you so you can check it matches what you are expecting and the persistent period etc is correct.
Users of an app I took over recently are reporting network error alerts like those:
Network error (-1009)
Network error (-1001)
Network error (-1005)
Network error (2)
(Fejl is Danish for Error)
The error are: NSURLErrorTimedOut, NSURLErrorNetworkConnectionLost, NSURLErrorNotConnectedToInternet, so mostly about bad/lost connection to the server.
AFNetworking 3.0 is used.
In the request headers we find Connection: close and the timeout is set to 15 seconds request.timeoutInterval = 30
First, I couldn't find showing an alert anywhere in the source code, so I would like to know if the displayed alerts on network errors are handled by iOS?
Then, I am looking for a way to simulate those errors. I tried with the Network Link Conditioner on a device but didn't get any of those errors.
The errors and their respective error codes are listed here:
https://developer.apple.com/reference/foundation/1508628-url_loading_system_error_codes?language=objc
I'm having grid of videos, AVPlayer sometimes fail to play video and showing this disabled icon with following error,
Domain=AVFoundationErrorDomain Code=-11850 "Operation Stopped" UserInfo={NSUnderlyingError=0x7f927ede4210
{Error Domain=NSOSStatusErrorDomain Code=-12939 "(null)"}
, NSLocalizedFailureReason=The server is not correctly configured., NSLocalizedDescription=Operation Stopped})
but same video getting played later on, so it is random issue. Any help on what's going wrong?
Search Error
I believe there are a lot of people, like me, are looking for the solution of this problem.
I spent a whole afternoon's time, finally solved the problem.
On the question, an error occurred when the video starts playing.
such as:
Domain=AVFoundationErrorDomain Code=-11850 "Operation Stopped"
then I search this error number, and find it:
AVErrorServerIncorrectlyConfigured = -11850
In Apple's Document, I find some information about this error.
The HTTP server sending the media resource is not configured as expected.
This might mean that the server does not support byte range requests.
Find Error
So, we should understand that this is a server problem.
Now, we play a video, and grab all http request for analysis.
Will find that AVPlayerItem sends an HTTP request.
when AVPlayerItem receive a video URL , it do the following task:
Send a bytes request HTTP Request, and range = 0 -1
If the response code is 206 and return 1 bytes data, It do the 3th task, if not, AVErrorServerIncorrectlyConfigured error occurred.
continue send other HTTP Request, to download segment of All duration. and the response of VideoData code must be 206
In my situation , when send range[0-1] HTTP request, the server side give me a 200 OK response, So error occurred.
Result
So, you need to ask your server engineer to detect all response who return.
I wish it could help you.
I corrected the leaderboard id in the new update of my iOS turn based game and now I'm getting this, has anyone seen this before?
This is right after submitting my turn data by calling endTurnWithNextParticipant.
It seems the server also can't match players against each other anymore but invites work fine.
Everything works fine in the simulator but not on the device.
Even with the error the data gets submitted and the other player sees it and can play the entire game to the end but this error gets logged with every turn:
Error Domain=GKErrorDomain Code=3 "The requested operation could not
be completed due to an error communicating with the server."
UserInfo=0xee64400 {NSUnderlyingError=0xee51590 "The operation
couldn’t be completed. status = 5001, Missing versions for adamId:
123456789 from bundleVersion: 1.4 adamId: 123456789 game: Tic Tac Toe
Unlimited Free compatGames:null", NSLocalizedDescription=The requested
operation could not be completed due to an error communicating with
the server.}
Any ideas?
Thanks