Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID
Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.

Mediaplayer framework crashing

AlanR917AlanR917 Posts: 58Registered Users
edited September 2012 in iPhone SDK Development
Here is my code for a movie player, I have about 20 of these:
//
// TurnerViewController.m
// LYWAM Tour
//
// Created by Alan Raff on 9/13/12.
//
//

#import "TurnerViewController.h"
#import <MediaPlayer/MediaPlayer.h>

@interface TurnerViewController ()

@end

@implementation TurnerViewController
@synthesize biaPlayer16;

-(void)biaVideo16
{
NSURL *url11 = [NSURL fileURLWithPath:[[NSBundle mainBundle]
pathForResource:@"Turner" ofType:@"mp4"]];
biaPlayer16 = [[MPMoviePlayerController alloc]
initWithContentURL:url11];

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:nil];

biaPlayer16.controlStyle = MPMovieControlStyleDefault;
biaPlayer16.shouldAutoplay = YES;
[self.view addSubview:biaPlayer16.view];
[biaPlayer16 setFullscreen:YES animated:YES];
}

-(void) moviePlayBackDidFinish:(NSNotification *)aNotification{
[biaPlayer16.view removeFromSuperview];
biaPlayer16 = nil;
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}

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

- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end
But every other time I press the "watch" button the app crashes, it doesnt do this on the simulator, only on the actual device. Any ideas?
Post edited by AlanR917 on

Replies

Sign In or Register to comment.