虽然通过身份验证,但MPMoviePlayerViewController无法播放视频

时间:2012-10-10 08:06:54

标签: iphone ios mpmovieplayercontroller mpmovieplayer

尝试使用MPMoviePlayerViewController查看视频时出现此错误。视频网址在Safari浏览器上运行良好,但在iPhone / iPad上运行不正常。

NSConcreteNotification 0x122b9ab0 {name = MPMoviePlayerPlaybackDidFinishNotification; object = <MPMoviePlayerController: 0x12243330>; userInfo = {
    MPMoviePlayerPlaybackDidFinishReasonUserInfoKey = 1;
    error = "Error Domain=MediaPlayerErrorDomain Code=-11829 \"Cannot Open\" UserInfo=0x122bc190 {NSLocalizedDescription=Cannot Open}";

使用Charles代理,我可以看到有请求:

Status  Complete
Response Code   401 Unauthorized
Protocol    HTTP/1.1
Method  GET
Content-Type    text/html

然后

Status  Complete
Response Code   206 Partial Content
Protocol    HTTP/1.1
Method  GET
Content-Type    video/mp4

然后

Status  Complete
Failure Client closed connection before receiving entire response
Response Code   206 Partial Content
Protocol    HTTP/1.1
Method  GET
Content-Type    video/mp4

同样的问题iOS: Playing video that needs authentication works in QuickLook but not in MPMoviePlayerViewController

0 个答案:

没有答案