私のアプリでは、共有ポイント サイトからビデオをストリーミングする必要があります。ビデオストリーミングに MPMoviePlayer コントローラーを使用しています。しかし、次のエラーで黒い画面が表示されます。
エラーの説明で再生に失敗しました:
エラー Domain=MediaPlayerErrorDomain Code=-11800 「操作を完了できませんでした」 UserInfo=0xbba7b90 {NSLocalizedDescription=操作を完了できませんでした}
このエラーはどういう意味ですか? これが認証の問題かどうかを知ることはできますか? もしくはシェアポイントサイトの問題。
NSURL *streamURL=[NSURL URLWithString:filePath];
credential = [[NSURLCredential alloc]
initWithUser: UserName
password: Password
persistence: NSURLCredentialPersistencePermanent];
protectionSpace = [[NSURLProtectionSpace alloc]
initWithHost:host
port:port
protocol: @"https"
realm:realm
authenticationMethod:NSURLAuthenticationMethodDefault];
[[NSURLCredentialStorage sharedCredentialStorage]
setDefaultCredential: credential
forProtectionSpace: protectionSpace];
NSLog(@"streamURL = %@",streamURL);
_streamPlayer = [[MPMoviePlayerController alloc] init];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleMPMoviePlayerPlaybackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:nil];
[_streamPlayer.view setFrame:CGRectMake(0, 0, self.documentView.frame.size.width, self.documentView.frame.size.height)];
_streamPlayer.shouldAutoplay=YES;
_streamPlayer.controlStyle = MPMovieControlStyleDefault;
_streamPlayer.movieSourceType=MPMovieSourceTypeStreaming;
[_streamPlayer setContentURL:streamURL];
[_streamPlayer prepareToPlay];
[_streamPlayer play];