An1Ba7
An1Ba7

Reputation: 355

Display image of first frame of movie in MPMoviePlayerController before playing movie

I am a beginner in iPhone Development. I have an object of MPMoviePlayerController which loads a video from my application resource bundle. I have set the backgroundColor of the MPMoviePlayer to clear color. I have set shouldAutoplay property to NO. Before the user clicks on the play button, a blank screen is displayed. I tried to get the first image using the following method

UIImage *thumbnail = 
[self.videoPlayer thumbnailImageAtTime:0 timeOption:MPMovieTimeOptionNearestKeyFrame];

But where do I set this image so that the black screen which appears before the user clicks on the play button will contain only the thumbnail image. Please help.

Upvotes: 4

Views: 5674

Answers (1)

DivineDesert
DivineDesert

Reputation: 6954

You are setting clear color as an background color. So try setting an imageview below ur movieplayer and if that continues to show black screen, add it above ur player. When the user plays video, just hide ur imageview.

Upvotes: 4

Related Questions