Answer Header from AVPlayer

I have a special use case where I need to track the response header from AVPlayer when it is streaming an HLS list. I searched the Internet and read the AVPlayer documentation and did not find a specific way to get this. I know that there is a way to get the HTTP response headers from the request made by the application, but I could not find anything to get the response header for the requests made by AVPlayer.

+5
source share
1 answer

I spent weeks trying to find a way to do this for both requests and responses to requests from playlists and snippets. The only way I was able to find a job was to pass the play request through the reverse proxy on the device. 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 AVPlayer.

I made a simple example project (with lots of comments and documentation) here: https://github.com/kevinjameshunt/AVPlayer-HTTP-Headers-Example

+1
source

Source: https://habr.com/ru/post/1241684/


All Articles