SOAP web service
을 사용하여 내 서버에 로그인합니다. 로그인하면 내가보고있는 파일 중 대부분이 로그인 한 사용자 만 사용할 수 있으므로 iOS는 NSURL
또는 그 밖의 세션을 만들어야합니다.iOS : 인증이 필요한 동영상 재생은 QuickLook에서 작동하지만 MPMoviePlayerViewController에서는 작동하지 않습니다.
MPMoviePlayerViewController
을 사용하여 비디오 파일을 미리 보려고하면 작동하지 않고 단지 viewController를로드 한 다음 닫습니다.
QuickLook
을 사용하면 비디오가 로컬에서 먼저 다운로드 되었기 때문에 아마 작동합니다.
하지만이 방법을 사용하고 싶지 않습니다. 사용자가 전체 비디오 파일을 다운로드하지 않아도되기 때문에 MPMoviePlayerViewController
을 사용하여 비디오를 스트리밍하고 싶습니다. NSURLCredential
에 대한 게시물을 보았습니다. 그러나 저에게는 효과가없는 것 같습니다. 이 비디오는 동영상 URL은 공공 사용자가 액세스하는 경우, 그들은 로그인 할 수있는 HTML 양식을 제시 로그인 한 사용자 바이들만 볼 수 있기 때문에
/**
* Play media session
*
* @version $Revision: 0.1
*/
- (void)playMediaWithURL:(NSString *)mediaURL {
// Authenticate
NSURLCredential *credential = [NSURLCredential credentialWithUser:@"myusername"
password:@"mypassword"
persistence:NSURLCredentialPersistenceForSession];
NSURLProtectionSpace *protectionSpace = [[NSURLProtectionSpace alloc]
initWithHost:@"mysite.com"
port:80
protocol:@"http"
realm:nil
authenticationMethod:NSURLAuthenticationMethodDefault];
[[NSURLCredentialStorage sharedCredentialStorage] setDefaultCredential:credential forProtectionSpace:protectionSpace];
// The movie player
NSURL *movieURL = [NSURL URLWithString:[mediaURL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
MPMoviePlayerViewController *tempPlayer = [[MPMoviePlayerViewController alloc]initWithContentURL:movieURL];
// Add observer
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification object:nil];
// Properties
tempPlayer.moviePlayer.allowsAirPlay = YES;
tempPlayer.moviePlayer.shouldAutoplay = YES;
tempPlayer.moviePlayer.useApplicationAudioSession = NO;
[self presentMoviePlayerViewControllerAnimated:tempPlayer];
[tempPlayer.moviePlayer play];
}//end
: 나는 (분명히 내 자신의 개인 정보를 추가) 사용 . 이 경우 NSURLCredential
이 작동하지 않습니까?
왜 NSURLConnection
작업에 대한 모든 호출을 사용하여 내 (예 : 비디오를 다운로드 등) 자격 증명에 기록되지만 MPMoviePlayerViewController
그 같은 자격 증명을 사용하는 것, 그것이 로그인을 얻는다 아마 때문에 (비디오를 재생하는 것을 거부하지 않는다 페이지)?
해결 방법이 있습니까? 아파치 설정에서
+1 좋은 질문입니다 - 답변에 호기심이 있습니다. 일반적으로 말하자면 MPMoviePlayerController (이전의 AVPlayer와 마찬가지로)는 공유 된 고수준 네트워킹 기능을 많이 사용하지 않는 것처럼 보입니다. – Till
iOS 개발자 지원 티켓 중 하나를 사용하고 Apple에이 질문을 보냈습니다. 그들이 말하는 것을 볼 것입니다 .. –
이것에 대한 뉴스? – Till