Movie player has invalid activation state (1)

Hello! I am shooting a thumbnail of a video from a video. And I use the following code to capture a sketch

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 use threading for this. I get the following error:

Movie has invalid activation state (1)

Can someone help me?

+5
source share
1 answer

When you initplay the player, you already have it. There can be only one MPMoviePlayerController. You probably do it in a loop. You need to set the last value nilor reuse the same thing over and over.

+13
source

All Articles