New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
iOS and Apps All your questions and discussion of iOS or iOS Apps.

How to play my video in landscape mode


Post Reply New Thread Subscribe

 
Thread Tools
B-ram

 
Member Since: Oct 20, 2010
Posts: 2
B-ram is on a distinguished road

B-ram is offline
Hi guys,

I have a video in my application but its portrait.

I want it Landscape but i really don't have any idea how to do that.

i used this code to make my video:

Code:
- (IBAction)playMovie:(id)sender
{
 NSString *filepath = [[NSBundle mainBundle] pathForResource:@"BAZO" ofType:@"m4v"];
 NSURL *fileURL = [NSURL fileURLWithPath:filepath];
 MPMoviePlayerController *moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:fileURL];

 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlaybackComplete:)name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayerController];

 [self.view addSubview:moviePlayerController.view];
 moviePlayerController.fullscreen = YES;
 //Uncomment om beeld formaat aan te passen
 //moviePlayerController.scalingMode = MPMovieScalingModeAspectFill;
 [moviePlayerController play];
}

- (IBAction)playSecondMovie:(id)sender{

 NSString *filepath = [[NSBundle mainBundle] pathForResource:@"00 01. Welcome" ofType:@"mov"];
 NSURL *fileURL = [NSURL fileURLWithPath:filepath];
 MPMoviePlayerController *moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:fileURL];

 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlaybackComplete:)name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayerController];

 [self.view addSubview:moviePlayerController.view];
 moviePlayerController.fullscreen = YES;
 //Uncomment om beeld formaat aan te passen
 //moviePlayerController.scalingMode = MPMovieScalingModeAspectFill;
 [moviePlayerController play];

}

- (void)moviePlaybackComplete:(NSNotification *)notification
{
 MPMoviePlayerController *moviePlayerController = [notification object];
 [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayerController];

 [moviePlayerController.view removeFromSuperview];
 [moviePlayerController release];
}

-(void) tableView: (UITableView*) tableView 
didSelectRowAtIndexPath: (NSIndexPath*) indexPath
{


 NSString *filepath = [[NSBundle mainBundle] pathForResource:@"BAZO" ofType:@"m4v"];
 NSURL *fileURL = [NSURL fileURLWithPath:filepath];
 MPMoviePlayerController *moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:fileURL];

 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlaybackComplete:)name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayerController];

 [self.view addSubview:moviePlayerController.view];
 moviePlayerController.fullscreen = YES;
 //Uncomment om beeld formaat aan te passen
 //moviePlayerController.scalingMode = MPMovieScalingModeAspectFill;
 [moviePlayerController play];

 /*-(void)loadVideo:(NSString *)name ofType:(NSString *)type{
  NSURL *url=[NSURL fileURLWithPath:[mainBundle pathForResource:@"BAZO"  ofType:@"m4V"]]
  if (!mp) mp = [[MPMoviePlayerController alloc] initWithContentURL:url];
  [mp play];
 }*/
}
I used this code to set the orientation:

Code:
[MPMoviePlayerController setOrientation:UIDeviceOrientationLandscapeLeft animated:NO];
But i heard form people that this will be rejected form the app store?

and it gives me this warning:

'MPMoviePlayerController' may not respond to '-setOrientation:animated:'

Whats happening?

Thanks!

Bram
QUOTE Thanks

Post Reply New Thread Subscribe


« Repeating Alarm Daylight Savings Bug | Bluetooth »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

All times are GMT -4. The time now is 05:39 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?