Question

We host a website with some videos, and we're aiming to restrict these videos so only an specific referer can access to them. We were using secdownload, but seems to be a pain with HTTP Live Streaming.

In our iPhone APP, we're trying to customize the HTTP Header fields by setting our custom referer or user-agent and be able to play this videos. We customize it this way

NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:self.UrlString]];
[theRequest setValue: customreferer forHTTPHeaderField:@"Referer"];

If we start a connection (NSConnection) everything is fine, but the problem comes when using with MPMoviePlayerController, because it seems that there is no way to customize its http requests.

You can specify an NSURL in MPMoviePlayerController, but doesn't seem to allow you to edit the request.

Am I missing something? If so, how do we achieve this? We're outputting the log from apache and all the HTTP requests made by the movieplayer have an empty referer.

Was it helpful?

Solution

That is correct. To use a MPMoviePlayerController with a different URL, you should release the original and alloc/initWithContentURL: a new one. You could consider adding a parameter to the URL, or customise the URL in some other way, to identify the referrer.

But I am aware of no way of getting at the NSURLRequest.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top