HTTP Response Header from AVPlayer

Hello,

Is there any way to get HTTP response headers from the AVPlayer when it is streaming a HLS stream.

Thanks.

Replies

I would also need this data, so i can handle some specific errors (http status 403).

it looks like no one from apple is participating on this secion

So far as I know, there is no way for you to get this information.


Our standard question is "What are you trying to do?".

That is, what is you want to do that you think you need this information in order to accomplish.


BTW, If you are not getting a good response thorugh this forum I would suggest using a tech suport incident.

(See https://developer.apple.com/support/technical/ )

I spent weeks looking for a way to do this for both requests and responses for the playlist and chunk calls from AVPlayer. The only way I was able to find that worked was by passing the playback request through a reverse proxy on the device itself. This allows you to intercept the request, add headers, send it to the real server, and then extract the headers from the response before returning it to the AVPlayer.


I made a simple example project (with lots of comments and documentation) here:

https://github.com/kevinjameshunt/AVPlayer-HTTP-Headers-Example