MPMoviePlayerViewController protected URL from yahoo hosted site using setDefaultCredential
<p>I am using similar code as mentioned in MPMoviePlayerViewController documentation. But it's not working. It says "you are not authorized..". My server is hosted on Yahoo. Url is something like this.</p>

<p><a href="http://www.someurl.com/tmp/somevideo.mp4" rel="nofollow">http://www.someurl.com/tmp/somevideo.mp4</a></p>

<p>Code is below</p>

<pre><code>NSURLCredential *credential = [[NSURLCredential alloc] 
                           initWithUser:@"abc" 
                           password:@"xyz"
                           persistence: NSURLCredentialPersistencePermanent];

 NSURLProtectionSpace *protectionSpace = [[NSURLProtectionSpace alloc]
                                     initWithHost:@"www.someurl.com"
                                     port:80
                                     protocol:@"http"
                                     realm:@"tmp"

   authenticationMethod:NSURLAuthenticationMethodDefault];

[[NSURLCredentialStorage sharedCredentialStorage] setDefaultCredential:credential
                                                forProtectionSpace:protectionSpace];

 [protectionSpace release];
 [credential release];
  MPMoviePlayerViewController *movie = [[[MPMoviePlayerViewController alloc] initWithContentURL:url] autorelease];
</code></pre>
