Content to stretch video in full screen mode

Preamble

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

There are function buttons in front of this video.

PROBLEM

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

Question

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

CODE

#import <MediaPlayer/MediaPlayer.h>

@interface MenuViewController ()

@property (nonatomic, strong) MPMoviePlayerController *mediaContent;

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

@end

@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];
}

@end

      

+3


source to share





All Articles