Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Movie player has wrong activation state (1)

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?

like image 663
Sharooue Naushad Avatar asked Jun 26 '12 07:06

Sharooue Naushad


1 Answers

When you are initing 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.

like image 54
Aaron Brager Avatar answered Oct 19 '22 06:10

Aaron Brager