views:

34

answers:

1

hi to all, I am creating a movie appliction in iphone/ipod .i have added a video to it . when i run it in simulator it runs properly in portrait mode.But when i run my app in ipod it opens a blank video and in landscape mode .but in simulator when i click on play my video directly plays in portrait mode and in ipod it opens a blank video in landscape mode which i want in portrait mode

This is my code for video:

-(IBAction)video1:(id)sender { NSBundle *bundle =[NSBundle mainBundle]; NSString *moviepath =[bundle pathForResource:@"CRY CRY - 90 Sec Video" ofType:@"mov"]; NSURL *movieURL =[[NSURL fileURLWithPath:moviepath]retain]; MPMoviePlayerController *theMovie =[[MPMoviePlayerController alloc]initWithContentURL:movieURL]; theMovie.scalingMode = MPMovieScalingModeAspectFill; [theMovie play]; MPMoviePlayerViewController *moviePlayer =[[MPMoviePlayerViewController alloc]initWithContentURL:movieURL]; [self presentMoviePlayerViewControllerAnimated:moviePlayer];

}

Please help me in solving this problem.

A: 

Hi Pradeep,

What version of iOS is your iPod running? Version 3.x will always open videos in landscape mode, version 4.x will open videos in the current orientation.

Simon Whitaker
my ipod is of 4.0 version but then too it is opening in landscape mode
Pradeep
please simon help me in solving this problem
Pradeep
thanks for your answer
Pradeep