2012-02-16 59 views
2

我开发了一个可以通过http播放视频(.mp4)的应用程序。根据许多教程,他们建议我使用MPMoviePlayerController。在我的工作场所,我必须进行代理服务器身份验证才能访问互联网,但我找不到任何示例代码来使用MPMoviePlayerController进行代理身份验证,因此我无法通过http播放任何视频。MPMoviePlayerController通过代理验证从url播放视频

你们有什么建议吗?

谢谢, 问候

回答

1

得到的溶液从苹果文献

NSURLCredential *凭证= [[NSURLCredential的alloc] initWithUser:@ “名为myUsername” 密码:@ “输入mypassword” 持久性:NSURLCredentialPersistenceForSession] ;

NSURLProtectionSpace *protectionSpace = [[NSURLProtectionSpace alloc] 
            initWithProxyHost:@"192.168.110.14" //proxy server 
             port:8080 
             type:NSURLProtectionSpaceHTTPProxy 
             realm:nil 
             authenticationMethod:NSURLAuthenticationMethodDefault]; 
[[NSURLCredentialStorage sharedCredentialStorage] 
setDefaultCredential: credential 
forProtectionSpace: protectionSpace]; 
[protectionSpace release]; 
[credential release]; 
相关问题