Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1053851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:18:58+00:00 2026-05-16T17:18:58+00:00

I would like to make an application in which, when I press a button,

  • 0

I would like to make an application in which, when I press a button, one video starts playing, and when it finishes or when I press “done” button it should take me to a view different from the first one where I launched the video.

Update:

This is the code I’m using but it doesn’t work. I need to use MPMoviePlayerViewController instead of MPMoviePlayerController. Any idea?

NSBundle *Bundle = [NSBundle mainBundle];
    NSString *moviePath = [Bundle pathForResource:@"video1" ofType:@"m4v"];
    NSURL *movieURL = [[NSURL fileURLWithPath:moviePath] retain];
    MPMoviePlayerViewController *moviePlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:movieURL];
    [self presentMoviePlayerViewControllerAnimated:moviePlayer];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(movieFinishedCallback:) name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayer];


- (void) movieFinishedCallback:(NSNotification*) notification {
    MPMoviePlayerViewController *moviePlayer = [notification object];
    [[NSNotificationCenter defaultCenter] 
     removeObserver:self
     name:MPMoviePlayerPlaybackDidFinishNotification
     object:moviePlayer];    
    [moviePlayer release];
    // dismiss your view or present a new view here.
    View1 *View1b = [[View1 alloc] initWithNibName:nil bundle:nil];
    View1b.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    [self presentModalViewController: View1b animated:YES];
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T17:18:58+00:00Added an answer on May 16, 2026 at 5:18 pm

    Unless you need something very custom, MPMoviePlayerController will probably suit your needs. You can add it to your view or a smaller subview, and you can disable the controls for fullscreen, etc. The url can be to a local file or remove resource.

    MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL: url];
    [player view].frame = [myView bounds];
    [myView addSubview: [player view]];
    [player play];
    

    Observe the MPMoviePlayerPlaybackDidFinishNotification to figure out when it is done, and from that observer’s block or selected method you can dismiss your view or present a new view.

    [[NSNotificationCenter defaultCenter] 
            addObserver:self
               selector:@selector(movieFinishedCallback:)                                                 
                   name:MPMoviePlayerPlaybackDidFinishNotification
                 object:player];
    

    Then

    - (void) movieFinishedCallback:(NSNotification*) notification {
        MPMoviePlayerController *player = [notification object];
        [[NSNotificationCenter defaultCenter] 
            removeObserver:self
                      name:MPMoviePlayerPlaybackDidFinishNotification
                    object:player];    
        [player release];
    
        // dismiss your view or present a new view here.
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to make some AIR application which would be used for tracking
Hi I have an application which uses opencart. I would like to make a
I would like to make a console application (c# 3.5) which reads stream input.
I would like to make my application ask the user some informations via something
I would like to make my own user-mode NAT application. I have the folowing
I have an application where I would like to make my reducers (I have
I'm developing a free application and would like to make some money by embedding
In our application, we would like to make a link to an online help
I have made a small application in Java and I would like to make
I'm building a Zend Framework 1.11.11 application and would like to make the routes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.