尝试使用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