2012-02-16 58 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]; 
相關問題