在我的应用程序中,我使用 mpmovieplayercontroller 播放视频
首先将缩放模式设置为 MPmovieScalingmodefill 并将视频正确显示为缩放模式。
然后在我全屏查看视频并退出全屏之后,不要将缩放模式设置为 MPmovieScalingmodeFill 并以默认模式显示视频。
在我的视频播放代码下方
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(ExitFullScreen:)
name:MPMoviePlayerWillExitFullscreenNotification object:nil];
[appDelegate.moviePlayerController setContentURL:fileURL];
if ([appDelegate checkDevice])
{
[appDelegate.moviePlayerController.view setFrame:CGRectMake(0,0, 320,463)];
}
else
{
[appDelegate.moviePlayerController.view setFrame:CGRectMake(0,0, 320,375)];
}
[appDelegate.moviePlayerController prepareToPlay];
appDelegate.moviePlayerController.scalingMode=MPMovieScalingModeFill;
appDelegate.moviePlayerController.controlStyle=MPMovieControlStyleDefault;
appDelegate.moviePlayerController.shouldAutoplay=NO;
[appDelegate.moviePlayerController setFullscreen:YES animated:YES];
[appDelegate.moviePlayerController play];
[self.view addSubview:appDelegate.moviePlayerController.view];
- (void)ExitFullScreen:(NSNotification *)notification{
NSLog(@"Exit full Screen");
[appDelegate.moviePlayerController setControlStyle:MPMovieControlStyleEmbedded];
[appDelegate.moviePlayerController setScalingMode:MPMovieScalingModeFill];}
所以我的问题是如何在退出全屏后设置缩放模式或在退出屏幕后不更改缩放模式?
请帮帮我。
谢谢。