I am using
MPMoviePlayerController
for play video and in this I used custom seek bar to jump video. but when I continuously do the seeking forward and rewind then application crashed and throw below error:
nsinvalidargumentexception' reason 'an avplayeritem cannot be
associated with more than one instance of avplayer'
So please suggest.
Thanks
Had same issue, try setting ContentURL after Setting the SourceType like below,
moviePlayerController_ = [[MPMoviePlayerViewController alloc] init];
moviePlayerController_.movieSourceType = MPMovieSourceTypeStreaming;
[moviePlayerController_.moviePlayer setContentURL:url];
Source: devforums.apple.com/message/467199
Had same experience. realized movieSourceType was set incorrectly. For example, movieSourceType was set to MPMovieSourceTypeStreaming when it should have been MPMovieSourceTypeFile for a movie embedded in the bundle.
I had the same problem and in my case the problem is that I couldn't tell if the movie is a file or a stream (the URL doesn't tell), so I set it to MPMovieSourceTypeUnknown
and that also solved the problem. It has that value by default but if you start playing a movie of either type, it internally changes the type to either stream or file and if you now change the URL without setting the correct type or manually setting type back to MPMovieSourceTypeUnknown
, you'll get an exception.