【问题标题】:MPMoviePlayerController: stream https URLs failedMPMoviePlayerController:流 https URL 失败
【发布时间】:2012-12-11 05:23:08
【问题描述】:

我搜索了所有类似的问题,但无能为力。 这是关于使用 MPMoviePlayerController 流式传输 https://172.16.58.100:8443/test02.mp4 URL。


我使用 MPMoviePlayerController 流式传输视频并在我的应用程序中播放。 http://172.16.58.100:8080/test.mp4 之类的 URL 可以,MPMoviePlayerController 工作正常。

但是像https://172.16.58.100:8443/test02.mp4、MPMoviePlayerController 这样的URL 不起作用,它返回MPMovieFinishReasonPlaybackError。我知道这意味着 videoPlayer 初始化失败并导致 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];

但还是报同样的错误(初始化失败,进入MPMoviePlayerPlaybackDidFinishNotification)

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

我的意思是我只想知道 MPMoviePlayerController 如何流式传输 URL,例如“https://xxx.xxx.xx.mp4”。

有什么建议吗?圣诞快乐。

【问题讨论】:

    标签: ios stream mpmovieplayercontroller


    【解决方案1】:

    也许我在服务器配置上犯了一个错误;现在更改为 webDav,流式传输 http&https 工作正常。

    【讨论】:

      猜你喜欢
      • 2014-02-25
      • 1970-01-01
      • 1970-01-01
      • 2014-05-12
      • 1970-01-01
      • 2018-08-02
      • 2011-02-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多