Welcome to iPadForums.net Guest - Click Here to Register

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 ...

Register with iPad Forums
+ Reply to Thread
Results 1 to 1 of 1
  1. #1
    iPad Noob!
    Member #
    26857
    Join Date
    Dec 2010
    Posts
    1

    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



Home | Forum | Active Topics | What's New

Sponsors

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Similar Threads

  1. Wi-Fi not working in hotel
    By kevgreen36 in forum iPad Help
    Replies: 5
    Last Post: 11-27-2010, 12:25 PM
  2. 3G Not Working
    By cherhall in forum iPad Help
    Replies: 0
    Last Post: 11-24-2010, 01:45 PM
  3. zoom not working
    By chisaki in forum iPad General Discussions
    Replies: 2
    Last Post: 09-01-2010, 03:50 PM
  4. My 3G isn't working...
    By Blind in forum iPad Help
    Replies: 2
    Last Post: 06-20-2010, 08:53 PM
  5. Videos are not working
    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.