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 11-18-2011, 05:54 PM   #1 (permalink)
Registered Member
 
Join Date: Nov 2011
Location: Easton, PA
Posts: 14
Marqui678 is on a distinguished road
Default Video only plays in Sim not on device.

I have 3 problems:
My video only plays in the simulator not my device. On my device it does not load. Just keeps spinning.

It is stuck in portrait mode.

How to stop memory leak error. (release it properly)



@implementation Buttons_and_BasicsViewController
@synthesize theMovie;
-(void)viewWillAppearBOOL)animated
{

NSString *moviePath = [ [[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"buttons.m4v"];

self.theMovie = [[MPMoviePlayerViewController alloc]
initWithContentURL:[NSURL fileURLWithPath:moviePath]];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlaybackComplete
name:MPMoviePlayerPlaybackDidFinishNotification
object:self.theMovie];

[self.view addSubview:self.theMovie.view];
self.theMovie.view.frame = CGRectMake(0, 0, 320, 410);
//---play movie---
MPMoviePlayerController *player = [self.theMovie moviePlayer];
[player play];

}

Last edited by Marqui678; 11-18-2011 at 06:54 PM.
Marqui678 is offline   Reply With Quote
Old 11-18-2011, 05:57 PM   #2 (permalink)
Registered Member
 
Join Date: Nov 2011
Location: Easton, PA
Posts: 14
Marqui678 is on a distinguished road
Default sorry the rest of it.

#pragma mark - View lifecycle

- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}

- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}


- (void)viewDidAppearBOOL)animated
{
[super viewDidAppear:animated];
}

- (void)viewWillDisappearBOOL)animated
{
[super viewWillDisappear:animated];
}

- (void)viewDidDisappearBOOL)animated
{
[super viewDidDisappear:animated];
}

- (BOOL)shouldAutorotateToInterfaceOrientationUIIn terfaceOrientation)interfaceOrientation {

return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}

@end
Marqui678 is offline   Reply With Quote
Old 11-18-2011, 06:12 PM   #3 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

You're kidding right? All that code is in the template UIViewController subclass file except for @synthesize theMovie. I don't even get how it's playing in the simulator if you aren't doing anything. If you want to know how to play a movie, look at this: Getting MPMoviePlayerController to Work with iOS4, 3.2 (iPad) and Earlier Versions of iPhone SDK
__________________
If you are looking for a quality developer, I'm your man. Give me a PM if you are interested.

New app - See screenshots and details at www.globaclock.com.

If you want to thank me, click the link. Every click counts. If you want to do more, buy my app. A link is available on my website. Thanks.
Domele is offline   Reply With Quote
Old 11-18-2011, 06:36 PM   #4 (permalink)
Registered Member
 
Join Date: Nov 2011
Location: Easton, PA
Posts: 14
Marqui678 is on a distinguished road
Default

I am Trying get the movie to play from the view controller once its pushed from the cell. I'll read throughs this thanks.

How can I it to play without playing it from a button? So that it just starts as the view is loaded.


I wish I was kidding but I am learning and adjusting fire as I go along.
Marqui678 is offline   Reply With Quote
Old 11-18-2011, 06:43 PM   #5 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

You should learn when all the viewWill and viewDid methods are called. In this case, you should look at viewWillAppear.

Code:
viewWillAppear:

Notifies the view controller that its view is about to be become visible.
- (void)viewWillAppear:(BOOL)animated
Parameters

animated

    If YES, the view is being added to the window using an animation.

Discussion

This method is called before the receiver’s view is about to be displayed onscreen and before any animations are configured for showing the view. You can override this method to perform custom tasks associated with presenting the view. For example, you might use this method to change the orientation or style of the status bar to coordinate with the orientation or style of the view being presented. If you override this method, you must call super at some point in your implementation.
From the docs.
__________________
If you are looking for a quality developer, I'm your man. Give me a PM if you are interested.

New app - See screenshots and details at www.globaclock.com.

If you want to thank me, click the link. Every click counts. If you want to do more, buy my app. A link is available on my website. Thanks.
Domele is offline   Reply With Quote
Old 11-18-2011, 06:50 PM   #6 (permalink)
Registered Member
 
Join Date: Nov 2011
Location: Easton, PA
Posts: 14
Marqui678 is on a distinguished road
Default

Thanks again.

Quote:
Originally Posted by Domele View Post
You should learn when all the viewWill and viewDid methods are called. In this case, you should look at viewWillAppear.

Code:
viewWillAppear:

Notifies the view controller that its view is about to be become visible.
- (void)viewWillAppear:(BOOL)animated
Parameters

animated

    If YES, the view is being added to the window using an animation.

Discussion

This method is called before the receiver’s view is about to be displayed onscreen and before any animations are configured for showing the view. You can override this method to perform custom tasks associated with presenting the view. For example, you might use this method to change the orientation or style of the status bar to coordinate with the orientation or style of the view being presented. If you override this method, you must call super at some point in your implementation.
From the docs.
Marqui678 is offline   Reply With Quote
Old 11-18-2011, 06:54 PM   #7 (permalink)
Registered Member
 
Join Date: Nov 2011
Location: Easton, PA
Posts: 14
Marqui678 is on a distinguished road
Default

Quote:
Originally Posted by Domele View Post
You're kidding right? All that code is in the template UIViewController subclass file except for @synthesize theMovie. I don't even get how it's playing in the simulator if you aren't doing anything. If you want to know how to play a movie, look at this: Getting MPMoviePlayerController to Work with iOS4, 3.2 (iPad) and Earlier Versions of iPhone SDK
Sorry I did not paste all of the code in the first time.
Marqui678 is offline   Reply With Quote
Reply

Bookmarks

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: 393
18 members and 375 guests
7twenty7, Alex-alex, Apptronics RBC, baja_yu, chiataytuday, dre, e2applets, ipodphone, jeroenkeij, jleannex55, leostc, matador1978, mbadegree, n00b, pbart, QuantumDoja, Retouchable, usernametaken
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,676
Threads: 94,125
Posts: 402,910
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jleannex55
Powered by vBadvanced CMPS v3.1.0

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