Video loads but doesn't play with MPMoviePlayerController in iPad
- by hgpc
I'm using MPMoviePlayerController to play videos in an iPad app. Everything works well on the iPad simulator.
On an actual device, the videos load but don't play, even if I press the play button. I can move the slider and see different frames of the video, but it never plays.
I'm using the following code:
moviePlayer = [[MPMoviePlayerController alloc] init];
moviePlayer.shouldAutoplay = YES;
moviePlayer.contentURL = video.urlVideo;
moviePlayer.view.frame = videoPlayerContainer.bounds;
moviePlayer.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[videoPlayerContainer addSubview:moviePlayer.view];
moviePlayer.controlStyle = MPMovieControlStyleEmbedded;
[moviePlayer play];
Help?