Movie player has wrong activation state (1)

喜夏-厌秋 提交于 2019-12-04 03:31:08

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/11202777/movie-player-has-wrong-activation-state-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!