1
我该怎么做?我不能只将userInteraction设置为NO,因为我仍然需要用户能够通过捏放/缩放来调整视频大小。我只是不希望玩家进入全屏模式。iOS - 禁用MPMoviePlayerController全屏的双指缩放
我该怎么做?我不能只将userInteraction设置为NO,因为我仍然需要用户能够通过捏放/缩放来调整视频大小。我只是不希望玩家进入全屏模式。iOS - 禁用MPMoviePlayerController全屏的双指缩放
希望这有助于!
- (void)viewDidLoad {
[super viewDidLoad];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(movieEventFullscreenHandler:)
name:MPMoviePlayerWillEnterFullscreenNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(movieEventFullscreenHandler:)
name:MPMoviePlayerDidEnterFullscreenNotification
object:nil];
self.moviePlayer.controlStyle = MPMovieControlStyleEmbedded;
}
- (void)movieEventFullscreenHandler:(NSNotification*)notification {
[self.moviePlayer setFullscreen:NO animated:NO];
[self.moviePlayer setControlStyle:MPMovieControlStyleEmbedded];
}
这绝对会使它恢复为“非全屏”模式。仍然希望有一种方法可以防止首先进入全屏模式。 – soleil 2012-07-16 23:34:50
你可以随时抛出某种UIView(加载屏幕或其他东西),然后在调用-movieEventFullScreenHandler后移除。这种做法很冒险。 – random 2012-07-23 20:05:47