Content to stretch video in full screen mode


I have enabled MPVideoPlayerController full screen on the back of the controller.

There are function buttons in front of this video.


Actual video content is limited to the central presentation parameters with a huge black border at either end [up / down]


How can I manipulate the actual size of the video content to consume the entire view / screen?


#import <MediaPlayer/MediaPlayer.h>

@interface MenuViewController ()

@property (nonatomic, strong) MPMoviePlayerController *mediaContent;

@property (strong, nonatomic) IBOutlet UIView *mediaContainer;


@implementation MenuViewController

// Background media.
- (void) executeMedia
    NSString *resourcePath = [[NSBundle mainBundle] pathForResource:@"static" ofType:@"mp4"];

    NSURL *mediaURL = [NSURL fileURLWithPath:resourcePath];

    self.mediaContent = [[MPMoviePlayerController alloc] initWithContentURL: mediaURL];

    self.mediaContent.controlStyle = MPMovieControlStyleNone;

    self.mediaContent.repeatMode = MPMovieRepeatModeOne;

    [self.mediaContent prepareToPlay];

    [self.mediaContent.view setFrame:self.mediaContainer.bounds];

    [self.mediaContainer addSubview:self.mediaContent.view];

    [self.mediaContent play];




source to share

All Articles