【发布时间】:2023-03-26 14:10:02
【问题描述】:
我在使用MPMoviePlayerViewController 以全屏模式播放视频时遇到问题(在正常模式下完美运行)。
代码:
if (PlayV) {
self.previewView.hidden=NO;
self.videoController =[[MPMoviePlayerController alloc] initWithContentURL:self.videoURL];
[self.videoController.view setFrame:self.previewView .frame];
self.videoController.view.center=self.playBtn.center;
[self.previewView addSubview:self.videoController.view];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(videoPlayBackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:self.videoController];
self.videoController.scalingMode = MPMovieScalingModeAspectFit;
self.videoController.controlStyle = MPMovieControlStyleNone;
[self.videoController play];
}
【问题讨论】:
-
请改进您的代码格式
-
@objectiveCoder 将您的解决方案发布为答案,而不是评论。 Stackoverflow 不是一个论坛,与您可能使用过的任何其他网站不同,因此请阅读faq。
标签: ios mpmovieplayer