का उपयोग कर याहू होस्टेड साइट से सुरक्षित यूआरएल संरक्षित यूआरएल MPMoviePlayerViewController
दस्तावेज में उल्लिखित समान कोड का उपयोग कर रहा हूं। लेकिन यह काम नहीं कर रहा है। यह कहता है "आप अधिकृत नहीं हैं .."। मेरा सर्वर याहू पर होस्ट किया गया है। यूआरएल की तरह this.MPMoviePlayerViewController setDefaultCredential
कोड कुछ नीचे
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];