![](/img/trans.png)
[英]An AVPlayerItem cannot be associated with more than one instance of AVPlayer'
[英]nsinvalidargumentexception' reason 'an avplayeritem cannot be associated with more than one instance of avplayer'
我在用
的MPMoviePlayerController
对于播放视频,在此我使用自定义搜索栏来跳转视频。 但是当我不断地进行前进和后退时,应用程序崩溃并抛出以下错误:
nsinvalidargumentexception'reason'avplayeritem无法与多个avplayer实例关联'
所以请建议。
谢谢
有同样的问题,尝试在设置SourceType之后设置ContentURL,如下所示,
moviePlayerController_ = [[MPMoviePlayerViewController alloc] init];
moviePlayerController_.movieSourceType = MPMovieSourceTypeStreaming;
[moviePlayerController_.moviePlayer setContentURL:url];
有相同的经验。 实现的movieSourceType设置不正确。 例如,movieSourceType设置为MPMovieSourceTypeStreaming,它应该是嵌入在包中的电影的MPMovieSourceTypeFile。
我有同样的问题,在我的情况下问题是我无法判断电影是文件还是流(URL没有告诉),所以我将它设置为MPMovieSourceTypeUnknown
,这也解决了问题。 它默认具有该值,但如果您开始播放任一类型的电影,它会在内部将类型更改为流或文件,如果您现在更改URL而不设置正确的类型或手动将类型设置回MPMovieSourceTypeUnknown
,您将会得到一个例外。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.