Im getting this error when trying to play a video from my temp directory:
NSString *tmpDir = [NSTemporaryDirectory() stringByAppendingString:@"/"];
NSString *url = [tmpDir stringByAppendingString:videoToPlay];
MPMoviePlayerController *player =
[[MPMoviePlayerController alloc]
initWithContentURL:[NSURL fileURLWithPath:url]];
Why am i getting this error "An AVPlayerItem can occupy only one position in a player's queue at a time."
Isnt that code correct? Am i missing something simple?
I tried various solutions provided in apple dev forums. In my case what worked was just changing the source type from streaming to unknown:
// player.movieSourceType = MPMovieSourceTypeStreaming;
player.movieSourceType = MPMovieSourceTypeUnknown;
Use following statement to avoid such error. Please keep in mind that, THE sdk that you are using is under NDA.
[self.mPlayer.moviePlayer setControlStyle:MPMovieControlStyleDefault];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With