Can I use AVURLAssetHTTPHeaderFieldsKey

Hello,

I want to set http header to the player and I found this stack overflow link explaining how to do it and works well for me.

But I was told that it was not part of the publicly available apis and apple may have a problem in using something like that in an app store app.

Could anyone clarifies that please.

I would be more than happy to implement something else if there is a way to achieve what I am looking for.

Thanks in advance.

http://stackoverflow.com/questions/15456130/send-headers-with-avplayer-request-in-ios

+1

I am also looking for an official support from Apple on this topic.

It's not in the headers, but it's in the open source webkit? That's odd.

For anyone finding this thread and looking for an answer, I was able to do it using a reverse proxy on the device. Take a look at my other reply here: https://forums.developer.apple.com/thread/31646

Hello @Dvyz, thank you for your post. AVURLAssetHTTPHeaderFieldsKey is not a supported API, so you should not use it. To provide custom headers while loading a media asset in AVPlayer, you can use AVAssetResourceLoader.

Hey Engineer,

thank you for your answer, but could you please elaborate a little more on AVAssetResourceLoader? According to stack overflow and my own tests, the delegate is not called with common schemes like https. Why do we need to set a custom scheme before AVAssetResourceLoader calls its delegate?

Can I use AVURLAssetHTTPHeaderFieldsKey
 
 
Q