iPad MPMoviePlayer hiccups
I'm working on an iPad app, it has a few videos within views using the MPMediaPlayer
framework.
Videos are working nice but on viewLoad there is a flashing of the video area when it loads the video. It shows black for a split second then starts playing.
I was thinking of using an NSTimer
on viewDidLoad
to unhide the hidden video view, which might give it a second to 开发者_运维知识库load up. Any other ideas?
The black flash is caused by the movie player drawing while it's waiting for movie data to load. I've also run into this recently and there aren't many options since the notifications don't really match up to the flashing. Best option I've done is to match the background color of the movie player to your background color. For example if you are displaying on a white context:
MPMoviePlayerController * player;
player.backgroundView.backgroundColor = [UIColor whiteColor];
My guess is, that you preferably put all MPMoviePlayer related code in ViewDidLoad. On another note: try giving a chance to MPMoviePlayerViewController which is accessibly in 3.2 and later, it's very handy to use.
I hope I could help.
*sam
精彩评论