Hi! I am capturing the thumbnail image of video from video url. And I am using following code to capture the thumbnail
MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc]initWithContentURL:movieURL];
[moviePlayer setControlStyle:MPMovieControlStyleFullscreen];
[moviePlayer setFullscreen:YES];
moviePlayer.useApplicationAudioSession = NO;
UIImage *image = [moviePlayer thumbnailImageAtTime:(NSTimeInterval)1.0 timeOption: MPMovieTimeOptionNearestKeyFrame];
I am using threading for this. I am getting the following error:
Movie player has wrong activation state (1)
Can anybody help me?
When you are init
ing the movie player, you already have one. There can be only one MPMoviePlayerController. You are probably doing this in a loop. You need to set your last one to nil
or keep reusing the same one over and over.
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