Estoy usando un código similar al mencionado en la documentación MPMoviePlayerViewController
. Pero no está funcionando. Dice "usted no está autorizado ...". Mi servidor está alojado en Yahoo. Url es algo así como this.MPMoviePlayerViewController URL protegida del sitio alojado de yahoo usando setDefaultCredential
Código está por debajo
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];