Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 07-27-2009, 11:36 PM   #1 (permalink)
New Member
 
Join Date: Jul 2009
Posts: 2
angelfilm is on a distinguished road
Exclamation iphone 3.1 - MPMediaPlayer shows up portrait, not landscape, which is strange…

I have a movie file that does work. I added a tableview controller inside a nav controller, inside a tab view controller, and when a user clicks on the table view cell I load the video view. It launches the movie(and rotates in the simulator), but the video doesn't play and the controls are for portrait view. I do hear sound and see time going by in the controls. So it's clearly just not landscape. I tried some tricks to setOrientation, but they had warnings and didn't work properly. Thanks for any help you can give.

Code:
@implementation StreamViewController
@synthesize moviePlayer;
@synthesize streamURL;

// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    return YES;
}
- (void)viewDidAppear:(BOOL)animated {

    NSBundle *bundle = [NSBundle mainBundle];
    if (bundle) 
    {
        NSString *moviePath                     = [bundle pathForResource:@"splash" ofType:@"m4v"];
        self.streamURL                          = [NSURL fileURLWithPath:moviePath];
    }

    moviePlayer                                 = [[MPMoviePlayerController alloc] initWithContentURL:[self streamURL]];
    moviePlayer.scalingMode                     = MPMovieScalingModeAspectFill;
    [moviePlayer play]; 
    [super viewDidAppear:animated];

}




- (void)dealloc {
    [super dealloc];
}


@end
angelfilm is offline   Reply With Quote
Old 07-28-2009, 02:03 PM   #2 (permalink)
New Member
 
Join Date: Jul 2009
Posts: 2
angelfilm is on a distinguished road
Smile Solved

I guess I was using multiple video players without releasing the first one. Using this helped to keep one MPMoviePlayerController active at all times, but switching it with this approach worked.

Code:
	MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] initWithContentURL:self.splashURL];
	mp.scalingMode				= MPMovieScalingModeAspectFill;
	if (mp)
	{
		// save the movie player object
		self.streamMoviePlayer = mp;
		[mp release];
		
		
		// Play the movie!
		[self.streamMoviePlayer play];
	}
angelfilm is offline   Reply With Quote
Old 08-05-2009, 04:23 AM   #3 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 20
Danny is on a distinguished road
Default

Quote:
Originally Posted by angelfilm View Post
I guess I was using multiple video players without releasing the first one. Using this helped to keep one MPMoviePlayerController active at all times, but switching it with this approach worked.

Code:
	MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] initWithContentURL:self.splashURL];
	mp.scalingMode				= MPMovieScalingModeAspectFill;
	if (mp)
	{
		// save the movie player object
		self.streamMoviePlayer = mp;
		[mp release];
		
		
		// Play the movie!
		[self.streamMoviePlayer play];
	}

[mMoviePlayer setOrientation:UIDeviceOrientationPortrait animated:NO];

try to add this to u r url
Danny is offline   Reply With Quote
Reply

Bookmarks

Tags
iphone, portrait, video

Thread Tools
Display Modes

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 On



» Advertisements
» Online Users: 322
11 members and 311 guests
chiataytuday, coolman, givensur, guusleijsten, ipodphone, jbro, mediaspree, mottdog, mtl_tech_guy, Punkjumper, vilisei
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,649
Threads: 94,114
Posts: 402,882
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Anwerbl
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:20 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0