Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

domain = AVFoundationErrorDomain , code = -11828

I am using the streaming url from CloudFront.

Sample URL: https://d14nt81hc5bide.cloudfront.net/qyYj1PcUkYg2ALDfzAdhZAmb

On Android , it is working fine but in iOS it says: domain = AVFoundationErrorDomain , code = -11828

From apple doc the error code 11828 is AVErrorFileFormatNotRecognized. The media could not be opened because it is not in a recognized format.

Can someone suggest how to fix this error?

like image 474
user3804063 Avatar asked Mar 26 '19 14:03

user3804063


2 Answers

AVFoundation can be picky if an URL or the header of the response does not contain information about container format of the media (mp4,mov,...), which is the case here (no 'file extension' in the URL, and no content type in the response header).
Other media libraries and players seem to willing to just start loading and then guess the format by inspecting the incoming data, which is probably why they work in this case.

Unfortunately, to my knowledge at least, there is no (reliable) way to tell AVFoundation programmatically the format to expect and go ahead with that.

like image 182
NoHalfBits Avatar answered Oct 19 '22 08:10

NoHalfBits


As you mention, This Error rise because AVFoundation can not recognize your media format.

Try to declare your mime type when upload media files to server

More about mime type here

more info: AWS streaming media content tutorial

like image 1
Wing Avatar answered Oct 19 '22 07:10

Wing