AVPlayer在播放流时通知AVPlayerItemFailedToPlayToEndTimeNotification。我使用以下代码并打印错误详细信息:
NSError *error = notification.userInfo[AVPlayerItemFailedToPlayToEndTimeErrorKey];
NSLog(@"itemFailedToPlayMPMovieFinishReasonPlaybackError=%@" ,error);
错误详情:
1. Error Domain=AVFoundationErrorDomain Code=-11853 "Stream has no valid
alternates" UserInfo={NSLocalizedFailureReason=This data is damaged, incomplete,
or incompatible., NSLocalizedDescription=Cannot Parse,
NSDebugDescription=Stream has no valid alternates, NSUnderlyingError=0x155aa070
{Error Domain=CoreMediaErrorDomain Code=-12880 "Can not proceed after removing
variant" UserInfo={NSDescription=Can not proceed after removing variant}}}
2. Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the
server." UserInfo={NSUnderlyingError=0x137d39380 {Error
Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo=
{NSErrorPeerAddressKey={length = 16, capacity = 16, bytes =
0x100201bb341a9f540000000000000000}, _kCFStreamErrorCodeKey=-2200,
_kCFStreamErrorDomainKey=4}}, NSErrorFailingURLStringKey=[FILTERED],
NSErrorFailingURLKey=[FILTERED], _kCFStreamErrorDomainKey=4,
_kCFStreamErrorCodeKey=-2200, NSLocalizedDescription=Could not connect to the
server.}
错误只发生在IOS上。我没有找到Code = -11853
我的问题:
1.这个错误的原因是什么?
2.如何解决?
由于