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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:57:57+00:00 2026-05-22T00:57:57+00:00

I am playing a video by using MPMoviePlayerController: NSString *urlStr = [[NSBundle mainBundle] pathForResource:@myvideo.MOV

  • 0

I am playing a video by using MPMoviePlayerController:

NSString *urlStr = [[NSBundle mainBundle] pathForResource:@"myvideo.MOV" ofType:nil];
NSURL *url = [NSURL fileURLWithPath:urlStr];
moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
[self.view addSubview:moviePlayer.view];
moviePlayer.view.frame = CGRectMake(0,0, 1024, 675);  
[moviePlayer play];

But requirement is that by default video should be in full screen and when I minimize it should be in above frame size.

Please help me out.

  • 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-22T00:57:58+00:00Added an answer on May 22, 2026 at 12:57 am

    Try this.

    #define degreesToRadian(x) (M_PI * (x) / 180.0)
    
    -(void)playMovieAtURL:(NSURL*)movieURL
    {
        if ([NSClassFromString(@"MPMoviePlayerController") instancesRespondToSelector:@selector(view)])
        {
    
     #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 30200
    
            // running iOS 3.2 or better
            mViewPlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:movieURL];
            mViewPlayer.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
    
            CGRect newFrame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
            mViewPlayer.view.frame = newFrame;
    
            CGAffineTransform landscapeTransform;
            landscapeTransform = CGAffineTransformMakeRotation(degreesToRadian(90));
            landscapeTransform = CGAffineTransformTranslate(landscapeTransform, 80, 80);
    
            [mViewPlayer.view setTransform: landscapeTransform];
    
            [self.view addSubview:mViewPlayer.view];
    
            [mViewPlayer.moviePlayer play];
    
            [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(movieDidExitFullscreen:)
                                                                                      name:MPMoviePlayerPlaybackDidFinishNotification
                                                                                      object:[mViewPlayer moviePlayer]];
    #endif
        }
        else 
        {
            MPMoviePlayerController *mMPPlayer = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
    
            mMPPlayer.scalingMode=MPMovieScalingModeFill;
            mMPPlayer.backgroundColor=[UIColor blackColor];
    
            [mMPPlayer play];
    
            [[NSNotificationCenter defaultCenter] addObserver:self 
                                                     selector:@selector(moviePlayerDidFinish:)
                                                                        name:MPMoviePlayerPlaybackDidFinishNotification
                                                                        object:mMPPlayer];
        }
    }
    
    /*---------------------------------------------------------------------------
     * 
     *--------------------------------------------------------------------------*/
    
    - (void) movieDidExitFullscreen:(NSNotification*)notification 
    {    
        //[[UIApplication sharedApplication] setStatusBarHidden:YES];
    
        /*/ Remove observer
        [[NSNotificationCenter  defaultCenter] 
         removeObserver:self
         name:MPMoviePlayerPlaybackDidFinishNotification 
         object:nil];
    
        [self dismissModalViewControllerAnimated:YES];*/
    
        [[NSNotificationCenter defaultCenter] removeObserver: self
                                                        name:MPMoviePlayerPlaybackDidFinishNotification
                                                      object: [notification object]];
    
        MPMoviePlayerController *theMovie1 = [notification object];
    
        [theMovie1.view removeFromSuperview];
        [theMovie1 release];
    }
    
    - (void) moviePlayBackDidFinish:(NSNotification*)notification 
    {    
        //[[UIApplication sharedApplication] setStatusBarHidden:YES];
    
        /*/ Remove observer
        [[NSNotificationCenter  defaultCenter] 
         removeObserver:self
         name:MPMoviePlayerPlaybackDidFinishNotification 
         object:nil];
    
        [self dismissModalViewControllerAnimated:YES];*/
    
        [[NSNotificationCenter defaultCenter] removeObserver: self
                                                        name:MPMoviePlayerPlaybackDidFinishNotification
                                                      object: [notification object]];
    
        MPMoviePlayerController *theMovie1 = [notification object];
    
        [theMovie1.view removeFromSuperview];
        [theMovie1 release];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using MPMoviePlayerController class for playing the video in built-in media player on
I am using flvplayer.swf player, it is playing the videos,but before playing the video
I am playing video using custom allocator using directshow. I want to set brightness,
I am playing a video using MediaPlayer . Now there is a mute/unmute button.
I'm using Flex 3 VideoDisplay class for playing streaming video. When I drag the
I am using the built in MPMoviePlayerController for playing videos.I've run in to a
According to developer.android.com, the Android supports the playing of video using the H.263, H.264
Hi all I video playing using the FLVPlayback component. I know I can use
I am trying to play video(.mp4) in my app using following code. NSString *doc
I'm using html5 video tag to play a video in dnn.Here .mov videos only

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.