Search code examples
iosmpmovieplayercontrollernsurlconnectionnsurlrequesthttp-live-streaming

Http live streaming: Forcing MPMoviePlayerController to pack headers in the http requests


I am streaming video from a server to iPhone using Http Live Streaming. I need to set certain headers in the http packets that the phone sends to the server.

For regular packets, the following code would suffice:

NSMutableURLRequest* request = [[[NSMutableURLRequest alloc] initWithURL:url]
                                autorelease];
[request setValue:VALUE forHTTPHeaderField:@"Field You Want To Set"];

Unfortunately, I did not find a similar API for MPMoviePlayerController. In other words, how do I force MPMoviePlayerController to set certain headers in the http packets that it uses to communicate to the server?


Solution

  • I think setting a cookie might solve your problem. Please look into the documentation for NSHTTPCookie and NSHTTPCookieStorage.