0

同様の質問をすべて検索しましたが、どうしようもありませんでした。https://172.16.58.100:8443/test02.mp4MPMoviePlayerController を使用して URL をストリーミングすることについてです。


MPMoviePlayerController を使用して動画をストリーミングし、アプリで再生します。のような URLhttp://172.16.58.100:8080/test.mp4は問題ありません。MPMoviePlayerController は正常に動作します。

しかしhttps://172.16.58.100:8443/test02.mp4、 MPMoviePlayerController のような URL は機能せず、 を返しますMPMovieFinishReasonPlaybackError。videoPlayer init が失敗してMPMoviePlayerPlaybackDidFinishNotification. これを行う方法がわかりません。

私もこれを試しました:

NSURLCredential *credental = [[NSURLCredential alloc]initWithUser:@"tomcat"
                                                         password:@"123456"
                                                      persistence:NSURLCredentialPersistenceForSession];
NSURLProtectionSpace *protectSpace = [[NSURLProtectionSpace alloc]initWithHost:@"172.16.58.100"
                                                                          port:8443
                                                                      protocol:@"http"
                                                                         realm:nil
                                                          authenticationMethod:NSURLAuthenticationMethodDefault];
[[NSURLCredentialStorage sharedCredentialStorage]setDefaultCredential:credental forProtectionSpace:protectSpace];

NSURL *fileURL = [NSURL URLWithString:@"https://172.16.58.100:8443/test.mp4"];
[self.moviePlayer playMovieFile:fileURL];

しかし、それでも同じエラーが表示されます (init が失敗し、MPMoviePlayerPlaybackDidFinishNotification に入ります)。

=============================

つまり、MPMoviePlayerController で「https://xxx.xxx.xx.mp4」のような URL をストリーミングする方法を知りたいだけです。

なにか提案を?メリークリスマス。

4

1 に答える 1

0

サーバーの構成を間違えたのかもしれません。今度はwebDavに変更し、http&httpsのストリーミングは正常に機能します。

于 2013-01-08T10:38:28.213 に答える