Taking video from video camera and displaying it with MPMoviePlayerController IPhone SDK
- by Daniel
Has anyone tried taking a video from the camera and then using the video player provided to play it? When you take the video in portrait mode, sometimes the movie will play (when the player puts it in landscape mode) and when it puts it in portrait mode you cannot view the movie all you hear is sound,sometimes in landscape mode is flickers and does not play right, has anyone encountered this and found a way to fix it? My code to play the video looks like this:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
NSURL *urls=[info objectForKey:@"UIImagePickerControllerMediaURL"] ;
moviePlayer =
[[MPMoviePlayerController alloc] initWithContentURL:[info urls]];
if (moviePlayer)
{
[moviePlayer play];
}
}
I checked settings on the docs nothing seems like it would fix this...Thanks