PREAMBLE
我在视图控制器后面的全屏视图中嵌入了一个MPVideoPlayerController。
在所述视频前面是功能按钮。
问题
实际视频内容仅限于视图的中心参数,两端都有巨大的黑色边框[顶部/底部]
问题
如何操纵实际视频内容大小以使用整个视图/屏幕?
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