MPMoviePlayerPlaybackDidFinishNotification not working on UITabBar tap
This is a discussion on MPMoviePlayerPlaybackDidFinishNotification not working on UITabBar tap within the iPad Development forums, part of the iPad App Store category; Hi
Noobie I'm afraid (but with some programming experience). I have a UITabBar where one of the the views (view 4) plays a video.
I ...
-
iPad Noob!
MPMoviePlayerPlaybackDidFinishNotification not working on UITabBar tap
Hi
Noobie I'm afraid (but with some programming experience). I have a UITabBar where one of the the views (view 4) plays a video.
I create a listener:
-(void)viewDidLoad {
NSString *path = [[NSBundle mainBundle] pathForResource:@"Sample" ofType:@"mp4"];
movieURL = [NSURL fileURLWithPathath];
moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
moviePlayer.controlStyle = MPMovieControlStyleDefault;
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(moviePlayBackDidFinish
name:MPMoviePlayerPlaybackDidFinishNotification
object:moviePlayer];
[moviePlayer.view setFrame:CGRectMake(0, 0, 1024 , 739)];
moviePlayer.view.backgroundColor = [UIColor grayColor];
[self.view addSubview:moviePlayer.view];
[moviePlayer prepareToPlay];
[moviePlayer play];
}
Here's the function:
- (void) moviePlayBackDidFinishNSNotification*)notification
{
[[NSNotificationCenter defaultCenter]
removeObserver:self
name:MPMoviePlayerPlaybackDidFinishNotification
object:moviePlayer];
moviePlayer.initialPlaybackTime = -1;
[moviePlayer stop];
[movieURL release];
[moviePlayer autorelease];
}
If I press another view UITabBar item the video continues playing in the background (as in I can hear the audio still). I f I return to the video view the app crashes.
How do I get the other UITabBar items to stop remove the MPMoviePlayerController instance if it's active?
TIA
JB
-
12-29-2010 05:21 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
Similar Threads
-
By kevgreen36 in forum iPad Help
Replies: 5
Last Post: 11-27-2010, 12:25 PM
-
By cherhall in forum iPad Help
Replies: 0
Last Post: 11-24-2010, 01:45 PM
-
By chisaki in forum iPad General Discussions
Replies: 2
Last Post: 09-01-2010, 03:50 PM
-
By Blind in forum iPad Help
Replies: 2
Last Post: 06-20-2010, 08:53 PM
-
By jonird in forum iPad Help
Replies: 0
Last Post: 05-21-2010, 06:42 PM
Search tags for this page
movie not playing uitabbar
,
movieplaybackdidfinish not being called
,
movieplaybackdidfinish not work
,
movieplaybackdidfinish not working
,
mpmoviecontroller disable zoom
,
mpmovieplayercontroller mpmovieplayerplaybackdidfinishnotification not working
,
mpmovieplayercontroller zoom
,
mpmovieplayerplaybackdidfinishnotification
,
mpmovieplayerplaybackdidfinishnotification example
,
mpmovieplayerplaybackdidfinishnotification iphone 3g
,
mpmovieplayerplaybackdidfinishnotification not being called
,
mpmovieplayerplaybackdidfinishnotification not called
,
mpmovieplayerplaybackdidfinishnotification not fireing
,
mpmovieplayerplaybackdidfinishnotification not firing
,
mpmovieplayerplaybackdidfinishnotification not received
,
mpmovieplayerplaybackdidfinishnotification not working
,
mpmovieplayerplaybackdidfinishnotification,
,
mpmovieplayerviewcontroller hide tabbar
,
name:mpmovieplayerplaybackdidfinishnotification
,
uitabbar ipad
Click on a term to search for related topics.