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 8386837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:03:09+00:00 2026-06-09T18:03:09+00:00

My code plays the video properly but not in full screen. ———– |_______ |

  • 0

My code plays the video properly but not in full screen.

-----------  
|_______  |  
|XXXXXXX| |  
|XXXXXXX| |    
-----------

Its size is about the size of the X filed area.
I am running this on an ipad2.

 NSString *urlStr = [[NSBundle mainBundle] pathForResource:@"movie.mp4" ofType:nil];
    NSURL *url = [NSURL fileURLWithPath:urlStr];
    videoPlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(movieFinishedCallback:)
                                                 name:MPMoviePlayerPlaybackDidFinishNotification
                                               object:videoPlayer];
    [self.view addSubview:videoPlayer.view];
    [videoPlayer setFullscreen:YES];
    videoPlayer.view.frame = [[UIScreen mainScreen] bounds];  
    [videoPlayer play];    
    [super viewDidLoad];    
  • 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-06-09T18:03:11+00:00Added an answer on June 9, 2026 at 6:03 pm

    Set the frame of your MPMoviePlayerController to 1024×768.

    videoPlayer.view.frame = CGRectMake(0,0,1024,768); //748 if you have status bar.
    

    Hope this is what you were looking for.
    *edit: Try this way, it’s the one I use.

    UIView *tempView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 1024, 768)];
    [self.view addSubview:tempView];
    
    playerViewController = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:@"www.orangebob.com/files/movie.mp4"]];
    
    [[NSNotificationCenter defaultCenter]
     addObserver:self
     selector:@selector(movieFinishedCallback:)
     name:MPMoviePlayerPlaybackDidFinishNotification
     object:[playerViewController moviePlayer]];
    
    playerViewController.view.frame = CGRectMake(0, 0, 1024, 768);
    [tempView addSubview:playerViewController.view]; //This *fixes* it, but it's kinda dirty.
    
    
    
    MPMoviePlayerController *player = [playerViewController moviePlayer];
    
    [player play];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Video not working properly in the below mentioned code. What could be the problem
I'm trying to play video from youtube using this code but I get this
The following code plays well on the simulator but the audio doesnt play on
I want to play an AVI video in my WInForm. I'm not worried about
I have used seekToTime in my application and its working properly. But I want
I have simple html code that plays YouTube video after click on the image:
I have a problem with my code that plays a video file. Whenever I
I have embedded flowplayer in my site but the flowplayer is not playing video
I want to create a audio or video controller, but my current code only
I am using the following code to play the video using the MPMoviePlayerController ,

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.